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: 504
Default Sorting Rows in VBA

OK. I've got a feeling that I'm going to feel like an idiot when someone
tells me what I'm doing wrong, but I am having trouble sorting rows in VBA.
Consider the following code snippet:

Dim intFirstRow, intSecondRow as Integer
intFirstRow = 9
intSecondRow = 15
With ActiveSheet
.Rows(intFirstRow, intSecondRow).Sort
End With

I keep getting run-time error 1004 which says "Application-defined or
object-defined error", which seems to mean: Something is wrong. VBA's not
sure what it is, but something is definitely wrong.

Alternatively, I tried the line:
.Rows(.Rows(intFirstRow),.Rows(intSecondRow)).Sort

I got the same error.

Can anyone point me in the right direction?

Thanks in advance!!!

--
Kevin
 
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
sorting out rows Tom Excel Worksheet Functions 2 June 9th 08 08:43 PM
Sorting rows into a row Sunnyskies Excel Discussion (Misc queries) 1 February 7th 08 12:00 AM
Sorting Rows Quick Orange Excel Worksheet Functions 1 August 6th 06 03:55 PM
Sorting rows Mario Excel Worksheet Functions 3 July 13th 06 06:51 PM
[sorting rows] digisummo Excel Worksheet Functions 1 June 16th 06 03:45 PM


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