Workbook Open
VBA Telemetry pings you when your VBA projects fail
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Workbook Open

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    496
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have 15 sheets in my Workbook and want to put code in the Workbook Open, the code works but I want the data to be entered on 5 different sheets in the same workbook with the same cell references. I have tried the
    select method and it still only enters the data on one sheet. Can someone help? thanks

  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Post the code that you've tried.

    oh, yeah, um,...please.

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Posts
    496
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    If (Now() >= A109) Then
    Workbooks("C Shift Time 4-15-02.xls").Worksheets("sup sample", "413 sample").Activate
    Range("B110") = 14
    Range("I110") = 12
    End If

  4. #4
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-17 11:48, Ralph M wrote:
    If (Now() >= A109) Then
    Workbooks("C Shift Time 4-15-02.xls").Worksheets("sup sample", "413 sample").Activate
    Range("B110") = 14
    Range("I110") = 12
    End If
    I'm assuming that this function works for the first sheet but you want to know how to make it work for the other 4 sheets. I hope this is pretty simple, I've tweaked your code slightly and have used a workbook with sheets named "Sheet1", "Sheet2" and "Sheet3" in this example:


    Worksheets((Array("Sheet1", "Sheet2", "Sheet3"))).Select
    Sheets("Sheet1").Range("B110").Value = "14"
    Sheets("Sheet1").Range("I110").Value = "12"


    You can change the names to whatever your sheetnames are and put this code within your "If" statement.

    HTH

  5. #5
    Board Regular
    Join Date
    Apr 2002
    Posts
    496
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Mark,
    It says the Sub Script is out of range?

  6. #6
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Did you change the sheet names to your actual sheet names? i.e.Change "Sheet1", "Sheet2" and "Sheet3" to whatever the names of your sheets are. (plus add in the names of the other two sheets you've got).

    If this code isn't getting placed in the actual workbook that these sheets are in, you'll also need to add in the ...Workbooks("blah blah") ...bit that you had in the original code.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com