LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Stupid Excel tricks

So the following code:

Public Sub addSheet()
Sheets.Add After:=Sheets(Sheets.Count)
Range("A6").Select
End Sub

It works just fine when it is in a module. Adds the sheet and
selects cell A6. But when it is in the code attached to another
worksheet, it adds the sheet then gives a 1004 error. It would
seem that the code attached to one sheet cannot select a cell on
another sheet.

I have just spent a frustrating several hours trying to figure
out why I was getting this error. Some days I feel very naïve.
 
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
Toolbar Gone - STUPID STUPID STUPID!! Paige Excel Programming 1 June 3rd 09 07:22 AM
Toolbar Gone - STUPID STUPID STUPID!! Simon Lloyd[_1145_] Excel Programming 1 June 2nd 09 04:09 PM
Toolbar Gone - STUPID STUPID STUPID!! Patrick Molloy Excel Programming 0 June 2nd 09 03:52 PM
Sources of Excel Tips, Tricks & Code John James Excel Discussion (Misc queries) 6 April 3rd 06 08:51 PM
Excel TIPS&TRICKS and Samples marko Excel Discussion (Misc queries) 4 November 30th 05 07:22 PM


All times are GMT +1. The time now is 05:15 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"