Selecting a range

S

Suh Suk Ho

Dear Colleagues;


I'm trying to find a value in a named range and, if the value I'm looking
for is found, then copy values in 4 cells right next to the cell and paste
it to a different location. As below;



For Each cell In Sheets("Specifications").Range("ModelName")

If cell.Value = frmModelSelect.lboxRight.List(i) Then
ActiveCell.Offset(0, 5) & "").Select

Selection.Copy

Sheets("Quotation").Range("A" & Cell_A25 & "").Select
ActiveSheet.Paste
Application.CutCopyMode = False

End If

Next

I thought the above Select method will do the work but it doesn't. How
should I do it? As you can see, I'm trying to select 4 cells in row right
next to the active cell. Please help!

Suh, Suk Ho
 
E

Ecco

Try without offset:

Sheets("Specifications").Range(cells
(cell.row,cell.column+1),cells
(cell.row,cell.column+5)).Select

-----Original Message-----
Dear Colleagues;


I'm trying to find a value in a named range and, if the value I'm looking
for is found, then copy values in 4 cells right next to the cell and paste
it to a different location. As below;



For Each cell In Sheets("Specifications").Range ("ModelName")

If cell.Value = frmModelSelect.lboxRight.List(i) Then
ActiveCell.Offset(0, 1) & ":" &
 
D

Dave Peterson

How about:

cell.offset(0,1).resize(1,4).copy

instead of the .select and the .copy lines.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Selecting a range : New Question 6
Need Help with a VBA subroutine 0
Help me4 2
Help me5 1
works in 2007 but not in 2010 0
Help merging two VBA codes 2
Drop down list control value in vba 2
End(xlDown) Issue 1

Top