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: 42
Default Get a range of cells from a selection of cells

I currently have some code that searches a range for a specific value in one
column. When it finds that value the entire row is selected and added to
range of rows using the Union method. When the search is over, the rows are
deleted.

I want to adapt the code to find the rows as it does, but then select the
same range of columns within each row so that I can copy and paste them to
another sheet. However, I can't paste rows into the cell I want to because
the selections don't match.

My dilemma is that I know how to capture the number of rows selected from
the code, but don't know how to select the same number of rows on the paste
sheet, starting at a specified row.

Alternately, if I could select just the range of columns within the selected
rows in the first place, that would help too. I looked at various angles, and
finally tried this: rngFoundAll.Columns.Select = "B:F". Unlike previous
attempts with Columns property syntax, it at least compiled, but generated
Error 424 (object required) after running the code above it.

If someone could help with this, as always, much appreciated. I think the
second approach would be more elegant, but either one would accomplish what
I'm looking for. Thanks again.

Dan
 
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
need to save values from a range of cells based on selection from list vhrao Excel Programming 1 July 19th 06 02:49 AM
creation of name range without selection of cells Jim at Eagle Excel Programming 2 June 16th 06 08:23 PM
duplicate listbox selection to range of cells? lozc Excel Programming 4 February 9th 06 01:02 AM
random selection from a range of cells tjb Excel Worksheet Functions 1 February 15th 05 06:34 PM
Excel - Copy range of cells based on Combobox Selection Excel-erate2004 Excel Programming 2 April 3rd 04 05:35 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"