With End With question

G

Guest

The first routine (below) works, but when I try the second one, only the
paste funtion works. I don't understand why the activate and select funtions
don't work in the With End With routine. Can anyone explain this to me?
Thanks,
Steve

Sheets("Temp").Select
Range("A4").Paste
Range("A1").Activate
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy

With wsTemp
.Range("A4").Paste
.Range("A1").Activate
.Range(ActiveCell, ActiveCell.End(xlDown)).Select
.Selection.Copy
End With
 
G

Gary Keramidas

the sheet needs to be ative in order to select a cell.

if wstemp is the sheet, then just add
..activate


With wsTemp
.Range("A4").Paste
.activate
.Range("A1").Activate
.Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy
 
G

Guest

Thanks, Gary, for clearing that up.

Steve

Gary Keramidas said:
the sheet needs to be ative in order to select a cell.

if wstemp is the sheet, then just add
..activate


With wsTemp
.Range("A4").Paste
.activate
.Range("A1").Activate
.Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy
 

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

Top