View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Generic reference in a Macro

Does this idea help?

Sub indexit()
x = Sheets(ActiveSheet.Index - 1).Range("g1")
MsgBox x
End Sub
--
Don Guillett
SalesAid Software

"Harry's GMail World" wrote in message
ps.com...
Would like to have a macro to transfer data from one sheet to the new
one.

I have a Feb sheet with data and want to transfer data to the NEW Mar
sheet.

Problem is that to do a MACRO for Mar from Feb-which works- would not
work in Apr to take data from Mar because the macro only sees for the
Mar from Feb named worksheets/macro.

Need to change the reference (previous month) to a generic
recognizable by the MACRO for all months.