LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default simple code not working

ossie - yes, it generally was the only workbook open & active at the
time of it executing, as it is now.

update:
our computer tech examined the coding & found everything was ok. he
made a copy of the sheet, deleted the original sheet, and renamed the
sheet to it's original name. now it works fine. don't know why!
thanks again
susan


On Apr 1, 11:41*pm, OssieMac
wrote:
If it has worked previously then it was pure chance that ThisWorkbook was the
ActiveWorkbook at the time thecodewas executed. You cannot Activate a
Workbook and Select a Worksheet in the one line. Need to first Activate the
Workbook and then Select the worksheet.

ThisWorkbook.Activate

Worksheets("Indirect Costs").Select

With Worksheets("Indirect Costs")
* * *.Range("a1").Select
End With

--
Regards,

OssieMac



"XR8 Sprintless" wrote:
On 31/03/2010 5:17 AM, Susan wrote:


Could it be assimpleas


Sheets("Indirect Costs").Select


* * *Range("A1").Select


thiscodebit has beenworkingforever. *recently had a virus& *had to
reinstall microsoft office 07. *now it won't work. *i'm assuming
there's some wording difference it's looking for - can anybody help me
out?
thanks.
susan
++++++++++++++++++++++++++++++++++++++
ThisWorkbook.Worksheets("Indirect Costs").Select


With Worksheets("Indirect Costs")
* * .Range("a1").Select
End With
++++++++++++++++++++++++++++++++++++++
i also tried the following which stops on "Activate":


With ThisWorkbook
* * * With Worksheets("Indirect Costs")
* * * * * *.Activate
* * * * * *.Range("a1").Select
* * * End With
End With
++++++++++++++++++++++++++++++++++++++


.- Hide quoted text -


- Show quoted text -


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple VBA Code Working in Excel 2007 but not Excel 2003 #N/A KMH Excel Programming 1 March 3rd 10 09:25 AM
Simple VBA Code written in Excel 2003 not working in Excel 2000 Rich B. Excel Programming 4 August 3rd 07 04:36 PM
Simple VBA code not working on new laptop Alex Excel Programming 6 June 14th 07 03:03 PM
This should be so simple but it's not working, please help tahrah Excel Programming 4 January 16th 07 12:11 AM
This should be simple but it's not working for me! hellokitty New Users to Excel 4 April 12th 05 01:26 AM


All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"