Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Go to lastrow using other column's lastrow

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Go to lastrow using other column's lastrow

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Go to lastrow using other column's lastrow

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Go to lastrow using other column's lastrow

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Go to lastrow using other column's lastrow

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Go to lastrow using other column's lastrow

Thanks a lot!!
All replies are just perfect for my problem!!


---
Message posted from http://www.ExcelForum.com/

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
Lastrow Bishop Excel Worksheet Functions 2 May 13th 09 05:22 PM
Lastrow Mr. Damon[_2_] Excel Worksheet Functions 3 July 30th 08 04:12 PM
HELP Lastrow Range Mr. Damon Excel Discussion (Misc queries) 1 July 29th 08 01:21 PM
LastRow of Data phmckeever Excel Worksheet Functions 1 December 1st 06 09:04 PM
Help with LastRow JStone0218 Excel Programming 4 December 4th 03 04:50 PM


All times are GMT +1. The time now is 05:50 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"