G
Guest
I'm having trouble with the syntax for using generic sheet names in a
macro/VBA in Excel. My working code follows where Sheet1='Part 1 Color 1'
and Sheet2='Part 1 Color 2'. I've tried using Sheet1 and Sheets(1) in every
possible format I can think of -- with and without apostrophes, quotes,
brackets, etc. -- but I keep getting error messages. Any and all help will
be appreciated!!
CODE:
Sub Consolidate_LH_RH()
'
' Consolidate_LH_RH Macro
' Macro recorded 12/18/2004 by Cindy Rogers
'
'
Range("Consolidate_ALL").Select
Selection.Consolidate Sources:=Array( _
"'Part 1 Color 1'!R29C1:R46C32" _
, _
"'Part 1 Color 2'!R29C1:R46C32" _
), Function:=xlSum, TopRow:=False, LeftColumn:=True,
CreateLinks:=False
ActiveWindow.SmallScroll Down:=23
Range("O61").Select
End Sub
macro/VBA in Excel. My working code follows where Sheet1='Part 1 Color 1'
and Sheet2='Part 1 Color 2'. I've tried using Sheet1 and Sheets(1) in every
possible format I can think of -- with and without apostrophes, quotes,
brackets, etc. -- but I keep getting error messages. Any and all help will
be appreciated!!
CODE:
Sub Consolidate_LH_RH()
'
' Consolidate_LH_RH Macro
' Macro recorded 12/18/2004 by Cindy Rogers
'
'
Range("Consolidate_ALL").Select
Selection.Consolidate Sources:=Array( _
"'Part 1 Color 1'!R29C1:R46C32" _
, _
"'Part 1 Color 2'!R29C1:R46C32" _
), Function:=xlSum, TopRow:=False, LeftColumn:=True,
CreateLinks:=False
ActiveWindow.SmallScroll Down:=23
Range("O61").Select
End Sub