+ Reply to Thread
Results 1 to 5 of 5

Updata new data between sheets by VBA

  1. #1
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Updata new data between sheets by VBA

    I have a code on the Excel file.

    I have some problems

    1. I have to add a contract number on Sheets("Sub1").[B1], Sheets("Sub2").[B1] and Sheets("Sub3").[B1] so the data will appear. If I just add the contract number in Sheets("Sub1").[B1], the data on Sub2, Sub3 won't appear.

    I want to add the contract number in Sheets("Sub1").[B1], the data in Sub1, Sub2, Sub3 will appear.

    2. It's about update button in Sub3. I have just update the new data on B4:B30, but I want that When I add the new data on F4:F11 so the data will be updated on Total.

    Thanks for helping.
    Attached Files Attached Files
    Last edited by dtaphuong; 08-25-2015 at 11:15 PM.

  2. #2
    Registered User
    Join Date
    02-06-2013
    Location
    Ezinge, The Netherlands
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    65

    Re: Fix the code

    Hi dtaphuong,

    For problem 1, change the code on sheet sub1 to:
    (after updating Sub1 the Sub2 and Sub3 will have the same update)
    Please Login or Register  to view this content.
    For problem 2, change the code in module3 to:
    (I do not fully understand the texts in the macro, but when I copy the update function for the B section to update F section, it seems to work)
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Re: Fix the code

    Quote Originally Posted by thelongpants View Post
    Hi dtaphuong,

    For problem 1, change the code on sheet sub1 to:
    (after updating Sub1 the Sub2 and Sub3 will have the same update)
    Please Login or Register  to view this content.
    For problem 2, change the code in module3 to:
    (I do not fully understand the texts in the macro, but when I copy the update function for the B section to update F section, it seems to work)
    Please Login or Register  to view this content.
    Thanks you.

    When I add the code for Problem 2 and press the update button, the data appears in wrong column.
    Besides, Then I add the number contract in Sub1, VBA appears "Run Time Error 6 - Overflow"

    I dont know how to fix it

    T

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Fix the code

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )

    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    02-06-2013
    Location
    Ezinge, The Netherlands
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    65

    Re: Updata new data between sheets by VBA

    Hi dtaphuong,

    Please update as requested and repost what you created so far.
    I checked today myself, but no bugs. Maybe you copied the new code section in wrong part of the function?

    Tom

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Pattern Building VBA Code - Working code, would like to use cleaner code
    By Benisato in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2015, 03:05 PM
  2. Re-code Userform to open range of sheets like previous sheet code
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2014, 02:31 AM
  3. [SOLVED] Excel VB code. Message pops up while code running asking question. Code must not wait.
    By Heinrich Venter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-28-2014, 06:10 AM
  4. [SOLVED] VBA code to save current worksheet as temporary PDF file and then add to my existing code
    By brianfromla in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-20-2014, 08:35 AM
  5. [SOLVED] VBA code for assigning a numeric code to text; then numeric code populates table
    By cteaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2014, 08:01 PM
  6. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  7. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM

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