Summary Page

G

Guest

I have a workbook with numerous worksheets. Every worksheet is set up the
same with the same headers etc. and the last row of text (which varies each
day) is a sum total of the values in column F. What I want to do is use some
type of code to say to copy the last cell in column F in worksheet A and
place it in the Sheet titled "Summary" in cell C4. Then do the same for the
other documents in the Workbook, for example

Last populated Cell in Col F in WS A copy to cell C4 in Summary Document
Last populated Cell in Col F in WS B copy to cell C6 in Summary Document
Last populated Cell in Col F in WS C copy to cell C8 in Summary Document.
Last popluated Cell in Col F in WS D copy to cell C10 in Summary Document

Can this be done with VBA? Thanks for your help.
 
K

kev_06

I haven't tried this yet, but if you have any troubles just write bac
and I'll try to get to it.

Dim lngcell As Long
Dim lngsummary As Long
Dim intsheets As Integer
Dim intcounter As Integer

For intsheets = 1 To Sheets.Count

For lngcell = 1 To 65536
If Worksheets(intsheets).Cells(lngcell, 6) = "" Then
Exit For
Else
intcounter = intcounter + 1
End If
Next

For lngsummary = 4 To (Sheets.Count * 2) Step 1
Sheets("Summary").Cells(lngsummary, 3)
Worksheets(intsheets).Cells(intcounter, 6)
Next

Nex
 
G

Guest

Hi Kev 06, I'm sorry to say I could not get this code to work. I'm adding
it to an existing Module so I put a sub name in front of it, that is the only
change I made, would that cause it not to work, I didn't think so? Can you
try it and let me know how you get it to work. Thanks so much.
 
K

kev_06

I need to know a little more about your spreadsheet:

Is column F in every sheet the same length?
If not, how many sheets are there?
What is the name of your summary page?
Are there empty rows between any entries in column F of ANY sheet?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top