View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2210_] Rick Rothstein \(MVP - VB\)[_2210_] is offline
external usenet poster
 
Posts: 1
Default Copy data from one tab to another based on cell value on one tab

You will use a structure similar to this...

Dim WS As Worksheet
For Each WS In Worksheets
If WS.Name = Format(Range("C10").Value, "mmmm d") Then
'
' << Do whatever here
'
Exit For
End If
Next

Put the code you say you know how to do where indicated.

Rick


"brentm" wrote in message
...
I have a spreadsheet where each tab represents 1 week. the tabs are named
based on the week ending date that tab covers - "June 25", "July 2", etc.
There is a master tab named "Invoice" with the period ending date residing
in
cell C10. Is there a way I can have a macro go to the appropriate tab
based
on the date entered in C10 on the "Invoice" tab? I need the macro to copy
over specific information, which I can do, but I wanted the macro to
automatically look at the value in C10 on "Invoice", then go get the
information from the appropriate tab that corrosponds to that cell value.
Anyone have any ideas?