Samadhan Gaikwad
Member
Hello,
I want to declare integer values say 7 to 13 globally and iterate all sub macros from 7 to 13. How can I do that?
Because my sheets and folder names (from which i am importing data) are ending with number.
e.g. PartData7, PartData8 etc. and H:\FeaturesData\data\7, H:\FeaturesData\data\8, etc
I have several sub macros where I have removed number and have added i value.
I want to declare integer values say 7 to 13 globally and iterate all sub macros from 7 to 13. How can I do that?
Because my sheets and folder names (from which i am importing data) are ending with number.
e.g. PartData7, PartData8 etc. and H:\FeaturesData\data\7, H:\FeaturesData\data\8, etc
I have several sub macros where I have removed number and have added i value.
Code:
Sub Main()
Dim i As Integer
' loop thru sheets and folders
For i = 7 To 13
Sheets("PartData" & i).Select
Range("A1").Select
test1
test2
Next i
End Sub
Sub test1()
Sheets("PartData" & i).Select
ActiveWindow.SmallScroll Down:=-3
Range("A2").Value = test
End Sub
Sub test2()
Sheets("PartData" & i).Activate
Range("A1").Value = 10
End Sub