+ Reply to Thread
Results 1 to 12 of 12

How to Automatically update data in other sheets in a workbook ?

  1. #1
    Forum Contributor
    Join Date
    03-28-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    157

    Question How to Automatically update data in other sheets in a workbook ?

    Hi, I am new to Excel VBA

    Problem - I have 3 tabsheets (All,Form461-0013,Rev01,Cost estimate). In each sheet ,i have one update button . How i can combine these "update" buttons in one single "update"button in the userform. so when you click the update button on userform. All the 3 sheets will automatically get updated !!
    Please help me !


    **Below codes are from 3 different sheet's Private SUB ()

    'All' sheet code

    Please Login or Register  to view this content.

    'Form461-0013,Rev01' code

    Please Login or Register  to view this content.

    'Cost estimate' code
    Please Login or Register  to view this content.
    Last edited by joh46k; 04-04-2013 at 03:26 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: How to Automatically update data in other sheets in a workbook ?

    1.Put an update command button on the userform
    2.From the userform command button sub call all three update subs

    IMPORTANT... Amend the range references in your code to include the sheet.... e.g. Range("A1") to Sheet1.Range("A1")
    Elegant Simplicity............. Not Always

  3. #3
    Forum Contributor
    Join Date
    03-28-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: How to Automatically update data in other sheets in a workbook ?

    @Andylitch: Not working!! ... using sub call 'All' sheet code and 'Form461-0013,Rev01' code working but 'Cost estimate' code not working

    Refer to POST#1

    Help me, please!!
    Last edited by joh46k; 04-04-2013 at 03:19 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: How to Automatically update data in other sheets in a workbook ?

    Did you amend the code in the cost estimate sub to include the sheet name ?

    Range("A25:A40").FormulaR1C1 = ......
    to
    sheet1.Range("A25:A40").FormulaR1C1 = .....

  5. #5
    Forum Contributor
    Join Date
    03-28-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: How to Automatically update data in other sheets in a workbook ?

    @ AndyLitch : No, i did not did any amendment to the code !!

    Do I need to change to that ,#4 ?
    Last edited by joh46k; 04-04-2013 at 03:27 AM.

  6. #6
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: How to Automatically update data in other sheets in a workbook ?

    Yes you MUST include the sheet name if you execute the code from a userform because if you don't the code will run on the visible (active) sheet instead of the sheet it was designed for.
    There are two main ways to specify a worksheet :-
    a) The Tab Name ............Sheets("Sheet1").Range("A1")etc
    b) The Vb name...............Sheet1.Range("A1")etc
    You can find the Vb name in the VBE project explorer ... The tab name is shown in brackets next to the Vb name.
    I recommend using the Vb name because it's fixed and never changes.

  7. #7
    Forum Contributor
    Join Date
    03-28-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: How to Automatically update data in other sheets in a workbook ?

    @AndyLitch: Thank You it's working...Do i also need to change for my 'Form461-0013,Rev01' code

    Please check my 'Form461-0013,Rev01' code !! -- #1

  8. #8
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: How to Automatically update data in other sheets in a workbook ?

    The Form... code is OK because it specifies the sheets
    The 'All' code does not - I recommend you change that to include the sheet name

  9. #9
    Forum Contributor
    Join Date
    03-28-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: How to Automatically update data in other sheets in a workbook ?

    @AndyLitch: OK sure . Is there any other short-cut way than 'using Call' . Did my program speed will decrease? if I use more Call for many sheets !!

  10. #10
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: How to Automatically update data in other sheets in a workbook ?

    Not really, no.. The speed will be much the same either way

  11. #11
    Forum Contributor
    Join Date
    03-28-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: How to Automatically update data in other sheets in a workbook ?

    @AndyLitch: Is this 'Worksheet_Change Event' same as Using Call function ?

    For Automatically update data in other sheets in a workbook ,is it possible to use 'Worksheet_Change Event' ?
    Last edited by joh46k; 04-04-2013 at 04:12 AM.

  12. #12
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: How to Automatically update data in other sheets in a workbook ?

    Worksheet_Change Event is triggered when a different cell is selected.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1