Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to get the row number of my last row in a selection dynamically
How do I get this? Thanks -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
if you want the last row in your current selection try sub foo() dim rng as range dim lastrow as long set rng = selection lastrow = rng.row+rng.rows.count-1 msgbox lastrow end sub -- Regards Frank Kabel Frankfurt, Germany I need to get the row number of my last row in a selection dynamically How do I get this? Thanks! --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if rTarget is your range, then
rTarget.Row is the first row, rTarget.Rows.Count is the number of rows, thus then last row is with rTarget lastrow = .Row + .Rows.Count -1 end with Patrick Molloy Microsoft Excel MVP ------------------ I feel Great! -----Original Message----- I need to get the row number of my last row in a selection dynamically How do I get this? Thanks! --- Message posted from http://www.ExcelForum.com/ . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
selection.rows(selection.rows.count).row
-- Regards, Tom Ogilvy "andycharger " wrote in message ... I need to get the row number of my last row in a selection dynamically How do I get this? Thanks! --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
MsgBox Selection.Rows.Count + Selection.Row - 1
Just in case you are looking for the last row of your selection on your workbook. Regards Robert "andycharger " wrote in message ... I need to get the row number of my last row in a selection dynamically How do I get this? Thanks! --- Message posted from http://www.ExcelForum.com/ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.655 / Virus Database: 420 - Release Date: 09/04/2004 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sumif number is greater than a number but less than another number | Excel Discussion (Misc queries) | |||
Find number of weekdays and wekend days given a total number of da | Excel Discussion (Misc queries) | |||
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? | Excel Discussion (Misc queries) | |||
How to calculate number of occurencies of a specific number number | Excel Discussion (Misc queries) | |||
Rounding a number to a multiple quantity that adds to a fixed total number | Excel Worksheet Functions |