Declaring a tab name as a variable

T

timmulla

Sub FormatFiles()

Dim TabNAME As String
Dim WB As Workbook
Do
Set WB = Workbooks.Open(Filename:=ActiveCell)
Set TabName = ActiveSheet.Name

My Macro code - This is just simple code to format the WB workboob that
was opened.

Workbooks()"Master file").Activate
Sheets("TabNAME").Range("B5:B102").FormulaR1C1 .... (vlookup formula to
the WB file.


WB.Close True 'Save Changes
ActiveCell.Offset(1).Select
Loop Until ActiveCell = ""
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top