Resize issue

S

Simon

HI everybody,

What is wrong with

export.Sheets("Sheet1").Range("C4").Resize(Range("F4").End(xlDown).Row,
4).Select

Thanks

because

export.Activate
Range("C4").Resize(Range("F4").End(xlDown).Row, 4).Select
Selection.Copy
AllJobVolumes.Activate

works?!
 
D

Don Guillett

If the other works then no selections necessary

export.Sheets("Sheet1").Range("C4").Resize(Range("F4").End(xlDown).Row,4).COPY
 
G

Gary Keramidas

maybe sheet1 is not the active sheet. no need to select, anyway, you're better
off without it.
 
D

Dave Peterson

Is F4 you're using on the same sheet as C4?

export.Sheets("Sheet1").Range("C4") _
.Resize(export.Sheets("Sheet1").Range("F4").End(xlDown).Row, 4).Select

And the export workbook has to be active
and sheets("sheet1") has to be active/selected

or

with export.sheets("sheet1")
application.goto .range("C4").resize(.range("F4").end(xldown).row, 4), _
scroll:=true 'or false
end with

And you don't have to worry about what workbook and what worksheet is active.

The "with" statement makes it less stuff to type -- and easier to understand for
me.
 
Top