LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Select two consecutive rows

I'll try this in the morning when I get to work, but is this going to work
if the active cell is blank, and the cell to the right and the cell below
are not blank?

Bruce
"Tom Ogilvy" wrote in message
...
Range(ActiveCell.End(xlDown),ActiveCell.End(xlToRi ght)).Select

Regards,
Tom Ogilvy



Bruce Roberson wrote in message
...
Tom:

Actually what I'm running into is this:

I'm sitting in Cell A10 which is the left most corner of an area I need
to highlight for an advanced query setup with fields. I got there with
the command below since I had been in Cell B10 when I made my copy of
the range type2header:

ActiveCell.Offset(0, -1).Select

From Cell A10, I have contiguous data beginning in cells A11 and in Cell
B10. From there it is contiguous down through lets say to cell S325. I
also have a complication in that Cells B326 through H326 should not be
highlighted as they are a different data type and not needed for the
advanced query operation. Now these are not finite row numbers; they
will always vary each month as to how far down it goes.

Ordinarily I might have done a selection of the current region, but I
guess you can see that won't work in this case. If I try and go end down
end right with the commands below, it does not work to make the
selection I need.

Range(ActiveCell, ActiveCell.End(xlDown)).Select
Range(ActiveCell, ActiveCell.End(xlToRight)).Select

So, I'm stuck at this point on how to highlight what I need.
Listed below is my full routine so far.
__________________________________________________ __________

Sub Copytype2hdr()
Range("startexportcell").Offset(1, 0).Select 'Selects B9
Selection.EntireRow.Insert 'Inserting one row
Range("Type2header").Copy 'header for adv query
ActiveCell.PasteSpecial xlPasteValues 'paste header in B10
Application.CutCopyMode = False
ActiveCell.Offset(0, -1).Select move cursor to A10
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Range(ActiveCell, ActiveCell.End(xlToRight)).Select
End Sub






*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!







 
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
Formula from consecutive rows to alternate rows? Neville Bailey[_2_] Excel Discussion (Misc queries) 2 March 25th 10 01:58 PM
Transposing data from consecutive rows into non-consecutive rows econ Excel Discussion (Misc queries) 0 March 10th 08 07:24 PM
min function on non consecutive rows bikemrh Excel Worksheet Functions 4 February 14th 07 08:44 PM
PULLING OUT CONSECUTIVE ROWS GARY Excel Discussion (Misc queries) 2 August 26th 06 04:25 AM
Select non-consecutive rows dee Excel Discussion (Misc queries) 14 December 4th 04 08:45 PM


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

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"