Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Select last cell in Selection

I am trying to write some VBA to use the row number of the last cell
in selection as a variable. How do you set this as a variable?

Thanks,
Jay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Select last cell in Selection

Const whatColumn as String = "A"
Dim lastrow
lastrow = Range(whatColumn & Rows.Count).End(xlUp).Row

"jlclyde" wrote:

I am trying to write some VBA to use the row number of the last cell
in selection as a variable. How do you set this as a variable?

Thanks,
Jay

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Select last cell in Selection

Hi

myrow = Selection(Selection.Count).Row

Mike

"jlclyde" wrote:

I am trying to write some VBA to use the row number of the last cell
in selection as a variable. How do you set this as a variable?

Thanks,
Jay

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Select last cell in Selection

On Jun 27, 3:04*pm, Mike H wrote:
Hi

myrow = Selection(Selection.Count).Row

Mike



"jlclyde" wrote:
I am trying to write some VBA to use the row number of the last cell
in selection as a variable. *How do you set this as a variable?


Thanks,
Jay- Hide quoted text -


- Show quoted text -


Mike H. ,
That is way too simple. I am glad I know that now.

Thank you for that.

Jay
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Select last cell in Selection

Your welcome and thanks for the feedback

Mike

"jlclyde" wrote:

On Jun 27, 3:04 pm, Mike H wrote:
Hi

myrow = Selection(Selection.Count).Row

Mike



"jlclyde" wrote:
I am trying to write some VBA to use the row number of the last cell
in selection as a variable. How do you set this as a variable?


Thanks,
Jay- Hide quoted text -


- Show quoted text -


Mike H. ,
That is way too simple. I am glad I know that now.

Thank you for that.

Jay

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
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
how to select fewer cells without canceling original selection excelconfusedgirl Excel Discussion (Misc queries) 7 August 10th 07 11:06 PM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
I do not see the selection colour when I select some cells dev Excel Discussion (Misc queries) 1 August 17th 06 01:40 PM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM


All times are GMT +1. The time now is 01:10 AM.

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

About Us

"It's about Microsoft Excel"