LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default sorting in a macro and defining last row into varible not working in

Dim LastRow99 As Long

LastRow99 = .Cells(.Rows.Count, "A").End(xlUp).Row

ActiveWorkbook.Worksheets("Working Sheet").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Working Sheet").Sort.SortFields.Add
Key:=Range( _
LastRow99), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:= _
xlSortNormal


I get Run-time error '1004':
Method 'Range' of object '_Global' failed
 
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
Defining cells that macro will change John K Excel Worksheet Functions 2 August 18th 09 11:49 PM
defining names in a macro guidop12 Excel Discussion (Misc queries) 6 August 28th 08 11:56 PM
Macro or VBA process varible row data Surrealdogma Excel Programming 1 June 29th 07 11:50 PM
Macro that sums cells in rows of varible number and.... blazzzercat Excel Programming 2 December 28th 06 10:32 PM
How to approach defining where macro looks? davegb Excel Programming 2 February 13th 06 03:42 PM


All times are GMT +1. The time now is 01:31 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"