G
Gene Augustin
Can't guess correct format for change sheet name.
Sub MultiColToSingle()
Dim ShtCount As Long
Dim shtnew As Workbook, shtold As Workbook
ShtCount = Sheets.Count
'get sheet name
sht = Sheets(1).Name
If sht <> "IIF" Then
' Change name to IIF
Sheets(1).Name = "IIF"
Set shtold = Sheets(1).Name 'Error here
'Set shtold = Sheets("IIF").Name 'Tried this, also Error here
Sheets.Add after:=Sheets("IIF")
Sheets(ShtCount).Name = "QIF"
Set shtnew = Sheets("QIF")
End Sub
Sub MultiColToSingle()
Dim ShtCount As Long
Dim shtnew As Workbook, shtold As Workbook
ShtCount = Sheets.Count
'get sheet name
sht = Sheets(1).Name
If sht <> "IIF" Then
' Change name to IIF
Sheets(1).Name = "IIF"
Set shtold = Sheets(1).Name 'Error here
'Set shtold = Sheets("IIF").Name 'Tried this, also Error here
Sheets.Add after:=Sheets("IIF")
Sheets(ShtCount).Name = "QIF"
Set shtnew = Sheets("QIF")
End Sub