View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default simple code not working

sigh. nope, nothing works. i even rearranged how the macro works
(because i wrote it 2 years ago as a beginner) & it still doesn't
work. i think i'm going to have to send it to don. i don't have code
cleaner on my computer anymore since the virus but i can get it again.
i appreciate the help from everybody!
:)
susan


On Mar 31, 9:51*am, Dave Peterson wrote:
ps. *If using the codename works, then I'd bet big money that the worksheet name
(that the user sees on the tab) was changed.

Maybe an extra space (leading/trailing/embedded????) or even a typo.





Dave Peterson wrote:

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


--

Dave Peterson- Hide quoted text -

- Show quoted text -