View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default simple code not working

Application.Goto Sheet4.Range("a1")



Susan wrote:

Application.Goto ThisWorkbook.Worksheets(Sheet4).Range("a1")

Sheet4 = ("Indirect Costs") in the properties window where it says
"Microsoft Excel Objects".
get same error.

ThisWorkbook.Activate
With Sheet4
.Activate
.Range("A1").Select
End With

errors out on "With Sheet4". worksheet is visible. this error is
occurring on all worksheets even back 2 years. it is the same
worksheet that gets saved month-to-month. code has not changed.
sheet name has not changed. i'm perplexed.
susan

On Mar 31, 8:09 am, aflatoon wrote:
The index number of the worksheet (the 4 in Worksheets(4)) is the
number of sheets counting from the left of the tab order. It has no
relation to the code name. If the code name is sheet4, then you should
be able to use:

ThisWorkbook.Activate
with Sheet4
.Activate
.Range("A1").select
End With

always assuming your sheet is visible...

Susan;686641 Wrote:

more info. i looked in the project properties & found that the

"Indirect Costs" sheet was sheet 4. so i changed the application.goto
coding to Worksheets(4).range("a1").select. and it selected the wrong
sheet. so in the immediate window i typed ?
ThisWorkbook.Worksheets(4).name & got a different name than the one i
expected. tried it with several other of the worksheets & got
additionally wrong information.


i think my virus is not gone after all.


susan


--
aflatoon

Regards,
A.
------------------------------------------------------------------------
aflatoon's Profile: 1501
View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=191759

http://www.thecodecage.com/forumz


--

Dave Peterson