Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2007

Tip: Looking for answers? Try searching our database.

Macro Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Martin - 29 Jun 2007 22:58 GMT
I have recorded a macro in excel and would now like to modify it but i could
use some help.

The first element of the macro is: -

Range("A1:A2651").Select

This selects the records in column A from row 1 to row 2651. I would like to
modify this to select from column A a range that starts with the first row
with a numerical value in it down to the last. I need to do this as the
worksheet the rest of the macro is acting on has a varying number of rows in
it each time it is produced

Grateful for the help

Paul Martin
Don Guillett - 29 Jun 2007 23:08 GMT
Any numerical value or a certain number?

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

>I have recorded a macro in excel and would now like to modify it but i
>could use some help.
[quoted text clipped - 12 lines]
>
> Paul Martin
Paul Martin - 29 Jun 2007 23:19 GMT
Last occupied cell in the column

> Any numerical value or a certain number?
>
[quoted text clipped - 14 lines]
>>
>> Paul Martin
Dave Peterson - 30 Jun 2007 05:01 GMT
Dim LastRow as long
with activesheet
  lastRow = .cells(.rows.count,"A").end(xlup).row
  .range("a1:a" & lastrow).select
  'or
  .range("a1",.cells(.rows.count,"A").end(xlup)).select
end with

Sometimes using a variable makes it easier if you have to use it later on.

> Last occupied cell in the column
>
[quoted text clipped - 20 lines]
> >>
> >> Paul Martin

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.