Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Find last row and column for 1st page only

Hi,

I need urgently to find last row and last column for 1st page in
printing using VBA. In my case when I print this worksheet it consist
multiple pages. The problem now I need to know for page one (1st page)
what is the last row and also column.
Could someone here can help.
Please...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Find last row and column for 1st page only

On Nov 12, 2:32*am, geniusideas wrote:
Hi,

I need urgently to find last row and last column for 1st page in
printing using VBA. In my case when I print this worksheet it consist
multiple pages. The problem now I need to know for page one (1st page)
what is the last row and also column.
Could someone here can help.
Please...


See:

http://groups.google.com/group/micro...3df557cae2a8d2

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Find last row and column for 1st page only

On Nov 12, 6:12*am, James Ravenswood
wrote:
On Nov 12, 2:32*am, geniusideas wrote:

Hi,


I need urgently to find last row and last column for 1st page in
printing using VBA. In my case when I print this worksheet it consist
multiple pages. The problem now I need to know for page one (1st page)
what is the last row and also column.
Could someone here can help.
Please...


See:

http://groups.google.com/group/micro...rogramming/bro...


You need a way for excel to help you find it such as a key word or row
number.
Send your file with a complete explanation and before/after examples
to dguillett1 @gmail.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Find last row and column for 1st page only

Dear Sir,

I just want to know how many rows and columns in 1st page of printing?
That it..
How to count rows and column in HpageBreaks or VPageBreaks for page 1
only..
Thanks anyway..
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Find last row and column for 1st page only

Thank you guys.. Finally I found the answer as below..

Sub FndFirstPageRowAndColumn()
Dim Col As Integer
Dim LstCol As Integer
Dim LstColPg
Dim LstRowPg
LstColPg = ActiveSheet.VPageBreaks(1).Location.Column - 1
LstRowPg = ActiveSheet.HPageBreaks(1).Location.Row - 1
MsgBox "Column" & "= " & LstColPg & Chr(10) & "Row" & "= " & LstRowPg
End Sub

Thanks anyway..


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Find last row and column for 1st page only

Thanks Guys..

I Found the answer as below..
Sub FndFirstPageRowAndColumn()
Dim iHBreaks As Integer, iVBreaks As Integer
Dim LstColPg
Dim LstRowPg
iHBreaks = ActiveSheet.HPageBreaks.Count + 1
iVBreaks = ActiveSheet.VPageBreaks.Count
If iVBreaks 1 Then
LstColPg = ActiveSheet.VPageBreaks(1).Location.Column - 1
Else
LstColPg = ActiveCell.SpecialCells(xlCellTypeLastCell).Column
End If
If iHpBreaks 1 Then
LstRowPg = ActiveSheet.HPageBreaks(1).Location.Row - 1
Else
LstRowPg = ActiveCell.SpecialCells(xlCellTypeLastCell).Row
End If
MsgBox "Column" & "= " & LstColPg & Chr(10) & "Row" & "= " & LstRowPg
End Sub

Thanks anyways..
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Find last row and column for 1st page only

via Google I saw this link
http://www.mrexcel.com/archive/VBA/19134.html
Looks very clever, not sure I understand it but could be a starting point


Jim


"geniusideas" wrote in message
...

Hi,

I need urgently to find last row and last column for 1st page in
printing using VBA. In my case when I print this worksheet it consist
multiple pages. The problem now I need to know for page one (1st page)
what is the last row and also column.
Could someone here can help.
Please...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find last row value in column when using MATCH to find column Bouce Excel Worksheet Functions 6 February 6th 08 10:16 PM
Find something in column a then find if column B matches criteria Darrell_Sarrasin via OfficeKB.com Excel Discussion (Misc queries) 8 November 28th 07 09:40 PM
Print a long 2 page column list, on one page Stella Excel Discussion (Misc queries) 6 May 2nd 07 05:09 AM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Find specific column titles and copy the column to new workboo JLGWhiz Excel Programming 0 December 11th 06 11:09 PM


All times are GMT +1. The time now is 07:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"