#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default activesheet

""" sheet2 is active at this pt """" then the following code

Sheets.Add After:=Sheets(3)
ActiveSheet.Name = this_no
Range("A1").FormulaR1C1 = this_no

Why would line 3 place "this_no" on sheet2
--
Jim at Eagle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default activesheet

Code run from within a sheet (not a module) only deals with itself unless
otherwise told. That is one of the reasons I like using objects when I create
books or sheets. Try this...

dim wks as worksheet

set wks = worksheets.add

with wks
wks.name = this_no
wks.range("A1").FormulaR1C1 = this_no
end with

Any time you need the new sheet just type wks and... Bob's your uncle...

HTH

"Jim at Eagle" wrote:

""" sheet2 is active at this pt """" then the following code

Sheets.Add After:=Sheets(3)
ActiveSheet.Name = this_no
Range("A1").FormulaR1C1 = this_no

Why would line 3 place "this_no" on sheet2
--
Jim at Eagle

Reply
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
Get ActiveSheet name in VB Geoff Lambert[_2_] Excel Programming 1 October 8th 04 02:25 PM
name of the activesheet rasta Excel Programming 1 October 3rd 03 09:49 PM
ActiveSheet.Name? Andrew Stedman Excel Programming 5 July 30th 03 01:17 PM
ActiveSheet Graham[_3_] Excel Programming 0 July 30th 03 09:08 AM
ActiveSheet Ron de Bruin Excel Programming 0 July 29th 03 04:59 PM


All times are GMT +1. The time now is 01:24 AM.

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

About Us

"It's about Microsoft Excel"