ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Ending in Macros (https://www.excelbanter.com/excel-worksheet-functions/231232-ending-macros.html)

Evil with a K[_2_]

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
....

Dave Peterson

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

Gord Dibben

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
...




All times are GMT +1. The time now is 07:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com