+ Reply to Thread
Results 1 to 6 of 6

Code to move data from one table to another by clicking a button

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    NE
    MS-Off Ver
    2013
    Posts
    42

    Code to move data from one table to another by clicking a button

    What I am trying to accomplish is enter series of data into a table (column B&C). That table will get a total volume and calculate a weighted average (B13 & C13). I will then select a state from a drop down list (A13). Then I will click the macro button that will take the state selected from the drop down list and find it in the historical table. Then transfer the volume, low value, high value and weighted average value to the historical table (column G-K).

    I would like to have this done in a macro that I can attach to the blue button "Move" in the center of the worksheet.

    Any help you could provide would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Code to move data from one table to another by clicking a button

    Ok rlh,

    See if this code works for you and see attached.
    Please Login or Register  to view this content.
    VBA move cell data for rlh.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    08-21-2013
    Location
    NE
    MS-Off Ver
    2013
    Posts
    42

    Re: Code to move data from one table to another by clicking a button

    Thanks for the help

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Code to move data from one table to another by clicking a button

    Hello Mr. Marvin
    I have tested the file attached in Post #2 and I found that the cell I6 has the value 25 .. I think it should have the minimum value for the range B2:B12 which is 10,000 (In B3) and at the same time there is no 25 .. there is 25,000
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Code to move data from one table to another by clicking a button

    Yasser, Correct you are. My code (even though cute) is wrong. I didn't have the column in the second range cell. Try this code instead...

    Please Login or Register  to view this content.
    VBA move cell data for rlh 2.xlsm

    Thanks for not believing my answer and checking it. I was wrong and I hope rlh checks back to find a better answer. Rep given for finding my error.

  6. #6
    Registered User
    Join Date
    08-21-2013
    Location
    NE
    MS-Off Ver
    2013
    Posts
    42

    Re: Code to move data from one table to another by clicking a button

    Marvin and Yasser,

    Thank you both for your assistance. I did notice the error and was able to decipher where the correction needed to be made. The nuts and bolts of the code were exactly what I needed. I have just enough experience that I was able to make the change.

    Again thank you both for taking the time to assistance. This forum is an outstanding tool.

+ 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. Clicking a FORM CONTROL Button using VBA code.
    By ayush_9924 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2015, 12:47 AM
  2. [SOLVED] Code to move data from an entry table to a historical table by date.
    By rlh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2014, 11:04 AM
  3. How to get table just clicking a list down button
    By Mahadev87 in forum Excel General
    Replies: 0
    Last Post: 03-01-2013, 10:30 AM
  4. How to find the VBA code of a button without clicking it??
    By techcrium in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-19-2012, 02:36 PM
  5. Save data in more than one table by clicking single button.
    By shanew in forum Access Tables & Databases
    Replies: 1
    Last Post: 02-28-2009, 07:17 AM
  6. After clicking on button, move cursor to real position found value.
    By danusko in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2009, 02:42 AM
  7. Checkbox choices that run code on clicking command button
    By Sharky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2007, 05:30 PM

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