.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loop through sheet set

2 REPLIES 2
Reply
Message 1 of 3
demetrius.adams
397 Views, 2 Replies

Loop through sheet set

I have around 200 drawings in subset of a sheet set. Half of the sheet numbers are just numbers and the other half are numbers with a D at the end. I want to add a dash before the D if the sheet number has one. Basically, I need to make this

1
1D
2
2D
3
3D

look like this

1
1-D
2
2-D
3
3-D

I think only VBA has access to edit the sheetset so a lisp can't be used. I can write the loop to work in excel VBA, but I'm having trouble in autoCAD VBA because I don't know how to call out all of the sheets in the subset or the property that needs to be changed (the sheet number).

2 REPLIES 2
Message 2 of 3

I'm not sure if this will help at all but this is what I wrote that works in excel VBA. The lines in red are what need to be changed.

 

 

Public Sub Demolition()


 For Each cell In Range("E6:E13") 'Need to define every sheet in a subset
 
 If Right(cell.Text, 1) = "D" Then 'Need to call out the sheet number property
 
 cell.Value = Left(cell.Text, Len(cell.Text) - 1) & "-D" 'Same as above
 
 End If
 
 Next cell
 
 
End Sub

 

Message 3 of 3
Jeff_M
in reply to: demetrius.adams

This old Autodesk University class should give you the infomation you need.

Jeff_M, also a frequent Swamper
EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost