View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default simple code not working

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Susan" wrote in message
...
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