Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Matt
You can't select a cell on an inactive sheet. If your Sheets("Staff Monday") is the active sheet at the time, then the command would work, as would the more simple Range("B2").Activate I suspect you are copying by selecting the range first. There is no need to do this e.g. Sheets("Sheet1").Range("A2:A20").Select Selection.Copy Sheets("Sheet3").Range("A2") will make the ranges A2:A20 be marked on both sheets and Sheet3 will be the active sheet at that point whereas Sheets("Sheet1").Range("A2:A20").Copy Sheets("Sheet3").Range("A2") will make the copy and whatever sheet you were on at the time the command was executed will remain the active sheet. Only the range A2:A20 will be marked on Sheet3 -- Regards Roger Govier "MJKelly" wrote in message ... Hi, using excel 2003. Can you tell me why the following code is not working? Why do I have to perform this action in two steps? Not working: ThisWorkbook.Sheets("Staff Monday").Range("B2").Select Working: ThisWorkbook.Sheets("Staff Monday").Select Range("B2").Select I have pasted values to a large range in "Staff Monday" and do not want the range to remain selected once the code has run. thanks, Matt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 single cell selecting muliple cell | Excel Worksheet Functions | |||
Selecting a cell entry based on cell validation selection | Excel Worksheet Functions | |||
Transfer cell values to another cell by selecting button. | Excel Worksheet Functions | |||
enter text in cell just by selecting cell | Excel Programming | |||
Selecting 10 charcters on one cell and pasting to another cell | Excel Programming |