LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
MarkN
 
Posts: n/a
Default need a macro select all cells in a worksheet?

Hi Russ,

Your recorded line
Range("A1:AO297").Select
will select that range all the time.

If you want to select a dynamic range, select cell A1 and use the keyboard
press Ctrl and the * (this is Ctrl Shift 8 on the keyboard). If you record
this command, it will select the active range around A1.

--
Hope this helps,
MarkN


"Russ Tarafdar" wrote:

I am new to using macros. I have worksheet which will have different numbers
of rows of data from one month to the next. I am taking data that has been
copied from a browse of the main frame and need to format it to be copied
into a reconciliation worksheet.

The problem I am running into in recording the macro is that it ends up
hardcoding the range when I select all. A test macro I created for this part
of the functionality follows:

Sub test()
'
' test Macro
' Macro recorded 6/22/2006 by ABC
'

'
Columns("C:C").Select
Selection.Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
Range("C1").Select
ActiveCell.FormulaR1C1 = "abc"
Columns("F:F").Select
Selection.Insert Shift:=xlToRight
Range("F1").Select
ActiveCell.FormulaR1C1 = "def"
Range("A1:AO297").Select
Range("F1").Activate
Selection.Replace What:="", Replacement:="filler", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("C2").Select
ActiveCell.FormulaR1C1 = "CODA"
Range(Selection, Selection.End(xlDown)).Select
Selection.FillDown
End Sub

Please indicate which lines of code need to be deleted and where to insert
the recommended change.

 
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
Running of Worksheet Change Macro breaks undo functionality. Rob Manger Excel Discussion (Misc queries) 1 April 6th 06 04:04 AM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Macro to search for and display data in another worksheet Mark H Excel Worksheet Functions 0 June 14th 05 12:40 PM
embedding worksheet cells in another worksheet SCW Excel Discussion (Misc queries) 2 April 25th 05 04:29 PM
select worksheet to run macro Hidaya Excel Discussion (Misc queries) 5 December 1st 04 11:54 PM


All times are GMT +1. The time now is 12:18 PM.

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"