Anonymous
2076 Views, 6 Replies
05-24-2017
06:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-24-2017
06:04 AM
I need help naming my sheets with the active sheets part number plus the sheet number. I have the part number portion working correctly but I cant get the sheet number portion to work. In the end I'm wanting my sheet name to look like "aaaaaab" (where as a=part number and b=sheet number).
Here is what I have so far:
SyntaxEditor Code Snippet
Dim oSheets As Sheets = ThisDrawing.Document.sheets Dim oSheet As Sheet Dim SheetNumber As Integer For Each oSheet In oSheets oSheet.activate oModel = IO.Path.GetFileName(ActiveSheet.View("ISO").ModelDocument.FullFileName) 'MessageBox.Show(oModel) oDoc = ThisDoc.Document SheetNumber = Mid(oDoc.ActiveSheet.Name, InStr(1, oDoc.ActiveSheet.Name, ":") + 1) partnum = iProperties.Value(oModel, "Project", "Part Number")("SheetNumber") 'MessageBox.Show(partnum) ActiveSheet.Sheet.Name = partnum Next
Solved! Go to Solution.