Hopefully an easy one...

klarowe

Active Member
Joined
Mar 28, 2011
Messages
389
Is there a way to change the order of the sheets in the VBA project window? I want to change the order around so that it matches the actual document, not alphabetical.

And on a side note/question, is there a way to export/save a VBA project as a word document so that I have a back-up of the code that I can easily copy/paste in the event of a loss of the code??? I found I can print it to PDF, but it doesn't allow me to select the text to copy/paste it.
Thanks!
 
Last edited:
I got to here so far:
Code:
Sub ChangeCodeNames()
    Dim i As Long
    For i = 1 To Worksheets.Count
        If i = 1 Then
            ActiveWorkbook.VBProject.VBComponents(Worksheets(i).CodeName).Properties("_CodeName") = "Sheet00" & i
        Else: ActiveWorkbook.VBProject.VBComponents(Worksheets(i).CodeName).Properties("_CodeName") = "Sheet0" & i
        End If
    Next i
End Sub

but I can't figure out how to replace "If i = 1" with "If i = 1-9"
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,224,590
Messages
6,179,749
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top