Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have the following problem
I want to use the column's G lastrow and go to the lastrow of th worksheet("A") activecolumn using a macro Be more specific last_row = Worksheets("A").Range("G65536").End(xlUp).Row Using the last_row i want to go to the last_row of the activecolumn. So if the last_row =120 and the activecolumn is "B" i want to go to th cell 'B120' Thanks in advance Stathi -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try LastRow = ActiveSheet.Cells(Rows.Count, activecell.column).End(xlUp).row or ActiveSheet.Cells(Rows.Count, activecell.column).End(xlUp).select -- Regards Frank Kabel Frankfurt, Germany i have the following problem I want to use the column's G lastrow and go to the lastrow of the worksheet("A") activecolumn using a macro Be more specific last_row = Worksheets("A").Range("G65536").End(xlUp).Row Using the last_row i want to go to the last_row of the activecolumn. So if the last_row =120 and the activecolumn is "B" i want to go to the cell 'B120' Thanks in advance Stathis --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
stakar,
This will select the cell that's in the same column as the current selection and the same row as the last used row in column G: Sub test() Dim last_row As Long last_row = Worksheets("A").Range("G" & Rows.Count).End(xlUp).Row Worksheets("A").Cells(last_row, ActiveCell.Column).Select End Sub hth, Doug "stakar " wrote in message ... i have the following problem I want to use the column's G lastrow and go to the lastrow of the worksheet("A") activecolumn using a macro Be more specific last_row = Worksheets("A").Range("G65536").End(xlUp).Row Using the last_row i want to go to the last_row of the activecolumn. So if the last_row =120 and the activecolumn is "B" i want to go to the cell 'B120' Thanks in advance Stathis --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
more consistent would be
Sub test() Dim last_row As Long last_row = Range("G" & Rows.Count).End(xlUp).Row Cells(last_row, ActiveCell.Column).Select End Sub Unless you want to base the last row on a sheet other than the active sheet. -- Regards, Tom Ogilvy "Doug Glancy" wrote in message ... stakar, This will select the cell that's in the same column as the current selection and the same row as the last used row in column G: Sub test() Dim last_row As Long last_row = Worksheets("A").Range("G" & Rows.Count).End(xlUp).Row Worksheets("A").Cells(last_row, ActiveCell.Column).Select End Sub hth, Doug "stakar " wrote in message ... i have the following problem I want to use the column's G lastrow and go to the lastrow of the worksheet("A") activecolumn using a macro Be more specific last_row = Worksheets("A").Range("G65536").End(xlUp).Row Using the last_row i want to go to the last_row of the activecolumn. So if the last_row =120 and the activecolumn is "B" i want to go to the cell 'B120' Thanks in advance Stathis --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
NoI was trying to respond to what seems to be the OP's specification of using Worksheet "A" both in the specification of last_row and in the Select. I see now that it doesn't work if Activecell is in other than Worksheet "A". Don't know if OP really wants to always go to "A", but if so, how's this? Sub test() Dim last_row As Long last_row = Worksheets("A").Range("G" & Rows.Count).End(xlUp).Row Application.Goto reference:=Worksheets("A").Cells(last_row, ActiveCell.Column) End Sub Doug "Tom Ogilvy" wrote in message ... more consistent would be Sub test() Dim last_row As Long last_row = Range("G" & Rows.Count).End(xlUp).Row Cells(last_row, ActiveCell.Column).Select End Sub Unless you want to base the last row on a sheet other than the active sheet. -- Regards, Tom Ogilvy "Doug Glancy" wrote in message ... stakar, This will select the cell that's in the same column as the current selection and the same row as the last used row in column G: Sub test() Dim last_row As Long last_row = Worksheets("A").Range("G" & Rows.Count).End(xlUp).Row Worksheets("A").Cells(last_row, ActiveCell.Column).Select End Sub hth, Doug "stakar " wrote in message ... i have the following problem I want to use the column's G lastrow and go to the lastrow of the worksheet("A") activecolumn using a macro Be more specific last_row = Worksheets("A").Range("G65536").End(xlUp).Row Using the last_row i want to go to the last_row of the activecolumn. So if the last_row =120 and the activecolumn is "B" i want to go to the cell 'B120' Thanks in advance Stathis --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot!!
All replies are just perfect for my problem!! --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lastrow | Excel Worksheet Functions | |||
Lastrow | Excel Worksheet Functions | |||
HELP Lastrow Range | Excel Discussion (Misc queries) | |||
LastRow of Data | Excel Worksheet Functions | |||
Help with LastRow | Excel Programming |