ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Summary Page (https://www.excelbanter.com/excel-programming/365694-summary-page.html)

SITCFanTN

Summary Page
 
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.



kev_06[_20_]

Summary Page
 

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

--
kev_0
-----------------------------------------------------------------------
kev_06's Profile: http://www.excelforum.com/member.php...fo&userid=3504
View this thread: http://www.excelforum.com/showthread.php?threadid=55661


SITCFanTN

Summary Page
 
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.

"kev_06" wrote:


I haven't tried this yet, but if you have any troubles just write back
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

Next


--
kev_06
------------------------------------------------------------------------
kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046
View this thread: http://www.excelforum.com/showthread...hreadid=556610



kev_06[_21_]

Summary Page
 

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?


--
kev_06
------------------------------------------------------------------------
kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046
View this thread: http://www.excelforum.com/showthread...hreadid=556610



All times are GMT +1. The time now is 06:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com