View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Cecilkumara Fernando Cecilkumara Fernando is offline
external usenet poster
 
Posts: 46
Default Names of worksheets

Mac,
Try

Sub checkData()
For a = 1 To Sheets.Count
Range("K" & a) = Sheets(a).Range("A3").Value
Next a
End Sub

if the final costing sheet is the last one of the book
you can use
For a = 1 To Sheets.Count - 1
to get the values of the rest
HTH
Cecil


"Mac" wrote in message
...
Hi all,
I am using a set of excel sheets to do some costing.
Because I have multiple sheets ( changes every project ) I
was hoping to write some code to copy the fields from each
sheet ( let just say A3 ) to the final costing sheet. To
do this I thought about assigning a variable to the name
of each sheet and using the variable to wite the formula.
Unfortunately I have trouble with the assigning of the
variable to the sheet name. I started with something
similar to this

For i = 1 To Worksheets.Count
tmpName = "sheets" & i
SName = Worksheets(tmpName).Name
does a) anybody understand my problem and b) can anyone
help
Thanks in Advance
MM