#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Ending in Macros

I am unfamiliar with the writing MACROs I rely specifically on recorded
macros. My issue is I format and consolidate a large number of excel files
prior placing it into access. The issue I have is when I recorded the macro
it stops at a certain point in the record. As the the records get larger and
larger the macros eithetr stop on a certain area or overwrite an area based
on my recorded keystrokes. Soooooo, How do I get the maco to encompass the
whole column with out writing 65000 into the macro (i am using 40235 below).
currently I am using this:
Cells.Select
Cells.EntireColumn.AutoFit
Columns("A:A").Select
Range("A1:AQ40235").Sort Key1:=Range("A1"), Order1:=xlDescending, Header
....
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Ending in Macros

Maybe...

With activesheet.usedrange
.columns.autofit
.sort key1:=.columns(1), ....

End with

Evil with a K wrote:

I am unfamiliar with the writing MACROs I rely specifically on recorded
macros. My issue is I format and consolidate a large number of excel files
prior placing it into access. The issue I have is when I recorded the macro
it stops at a certain point in the record. As the the records get larger and
larger the macros eithetr stop on a certain area or overwrite an area based
on my recorded keystrokes. Soooooo, How do I get the maco to encompass the
whole column with out writing 65000 into the macro (i am using 40235 below).
currently I am using this:
Cells.Select
Cells.EntireColumn.AutoFit
Columns("A:A").Select
Range("A1:AQ40235").Sort Key1:=Range("A1"), Order1:=xlDescending, Header
...


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Ending in Macros

Dim Lrow as Long

Lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:AQ" & Lrow)Sort Key1:=Range("A1"), Order1:=xlDescending, Header


Gord Dibben MS Excel MVP

On Mon, 18 May 2009 13:14:01 -0700, Evil with a K
wrote:

I am unfamiliar with the writing MACROs I rely specifically on recorded
macros. My issue is I format and consolidate a large number of excel files
prior placing it into access. The issue I have is when I recorded the macro
it stops at a certain point in the record. As the the records get larger and
larger the macros eithetr stop on a certain area or overwrite an area based
on my recorded keystrokes. Soooooo, How do I get the maco to encompass the
whole column with out writing 65000 into the macro (i am using 40235 below).
currently I am using this:
Cells.Select
Cells.EntireColumn.AutoFit
Columns("A:A").Select
Range("A1:AQ40235").Sort Key1:=Range("A1"), Order1:=xlDescending, Header
...


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
week ending peter Excel Worksheet Functions 4 April 3rd 08 03:31 AM
Ending another applicatoni Brettjg Excel Discussion (Misc queries) 0 March 3rd 08 12:01 AM
Ending a Sheet nabanco Excel Worksheet Functions 2 June 24th 07 01:23 AM
Week ending [email protected] Excel Worksheet Functions 3 November 1st 05 04:52 PM
Ending zero RAB Excel Discussion (Misc queries) 3 August 25th 05 06:09 PM


All times are GMT +1. The time now is 09:57 PM.

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"