Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
need to save values from a range of cells based on selection from list | Excel Programming | |||
creation of name range without selection of cells | Excel Programming | |||
duplicate listbox selection to range of cells? | Excel Programming | |||
random selection from a range of cells | Excel Worksheet Functions | |||
Excel - Copy range of cells based on Combobox Selection | Excel Programming |