+ Reply to Thread
Results 1 to 13 of 13

Multiple Loading Data Command Buttons and Formulas using a macro.

  1. #1
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Question Multiple Loading Data Command Buttons and Formulas using a macro.

    Hello Everyone,
    I am needing a little help with a project i have, if anyone of you could read over what i have written below and try to help me out with this one. Thanks in advance. I have attached 2 documents needed to understand this project.

    Start with the "Raw Test Data" named sheet, what i need to do is get the"Get Raw Data" Command Button to pull raw data from any file and paste values exactly the same as the source workbook it comes from onto this current sheet.
    Next is the "Offset Data" named sheet, what i need to do is get the"Get Offset Data" Command Button to pull raw data from any file and paste values exactly the same as the source workbook it comes from onto this current sheet.
    Now on the "Test Data" named tab is where i need the work to show. I need this sheet to do some calculations as information is input into the previous 2 tabs. I need a macro to automatically do the formula's for more and post them to this sheet. I have 6 set of difeerent data listed as VbX01, VbY01, VbZ01 for these 3 data points there are 32 of each one which i need averaged out and placed in a cell which i will mention later. After these 32 data points there is another set like SX01, SY01, SZ01 and the same for these which is 32 data points each. I would like these 6 data points to be average with each other. The following formula is how i need the outcome to be posted on this sheet. VbX starting in row 2 column E, then VbY would start on same row but next column F and then VbZ would be on same row but next column G and the same would go for SX, SY, SZ the column would continue on from the last and row would be the same. The below formula is what i need each one to be calculated before placing the data on this sheet.
    DATA FORMAT (18 Sept 2015):

    VBX_g = (VBXaverage - VBXoffset) / VBXscale
    VBXoffset = 0
    VBXscale = -260 …. Note: there is a negative sign.

    VBY_g = (VBYaverage - VBYoffset) / VBYscale
    VBYoffset = 0
    VBYscale = 260

    VBZ_g = (VBZaverage - VBZoffset) / VBZscale
    VBZoffset = 0
    VBZscale = 260

    SHX_g = (SHXaverage - SHXoffset) / SHXscale
    SHXoffset = 0
    SHXscale = 20

    SHY_g = (SHYaverage - SHYoffset) / SHYscale
    SHYoffset = 0
    SHYscale = 20

    SHZ_g = (SHZaverage - SHZoffset) / SHZscale
    SHZoffset = 0
    SHZscale = 20

    If i didnt answer any questions to go with this please let me know and i will answer them. This might be a little confusing so i will try to explain them as easy as possible.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    bump............

  3. #3
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    I could really use some help with this one please.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    your code looks rather daunting but ill give it a crack

    is sheet1 on test.xlsm what you want to end up with?
    where does the offset data come from? did you forgot to attach that file?
    if i'm understanding what you are wanting to do is get

    VBX_g = (VBXaverage - VBXoffset) / VBXscale
    VBXoffset = 0
    VBXscale = -260 …. Note: there is a negative sign.

    **ok sorry didnt read in full
    32 VBX + 32 SX data points/64 =VBXaverage

    so first row
    (-637+241) = -396/64 = -6.1875
    (-6.1875-0)/-260 = 0.023798077
    Last edited by humdingaling; 09-24-2015 at 11:12 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    ok i re-read it again

    i think i was right the first time
    VBX_average = average of 32 data points of vbx(1-32)
    SHX_average = average of 32 data points of sx(1-32)

    so for row of VBX_average = -637/32
    vbx_g = (-19.90625-0)/-260 = 0.0765625

    is this correct?
    Last edited by humdingaling; 09-25-2015 at 12:51 AM.

  6. #6
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    Yes this is the correct formula for VbX. If you get this one then the others will be the same concept.

  7. #7
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    Sorry forgot to answer some of your questions mentioned above.

    is sheet1 on test.xlsm what you want to end up with?
    Very similar on the setup of it yes but not exactly if i need to do an example sheet of how i need it setup i can but i tried to explain the setup the best i could.

    where does the offset data come from? did you forgot to attach that file?
    It will be similar to the same file i attached and i need to be able to open it up from a destination like the other tabs. It will be laid out in the same format as raw data and will need to be interchangeable just like the raw data.

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    Quote Originally Posted by jleal View Post
    where does the offset data come from? did you forgot to attach that file?
    It will be similar to the same file i attached and i need to be able to open it up from a destination like the other tabs. It will be laid out in the same format as raw data and will need to be interchangeable just like the raw data.
    im not sure if the solution i will give will be suitable for "similar"
    however given the code you have already in your file im sure you would be able to adjust it
    Please Login or Register  to view this content.
    i added extra columns into the raw test data spreadsheet to verify the sumproduct was getting the right outcome
    i left it with formula instead of hard coding it

    **note the mod is working on activesheet....only because i am using it to get the column number
    in hindsight should of made the columns lower range instead of doing minus after column
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    Awesome! This worked for the first part of what i needed. Now i need to be able to load another raw test data on the offsheet tab. Basically load just like the first tab does. When i try to load it off the offset data tab it does nothing. What i need it is to place the values on this sheet just like the raw test data one does.

    I will reattach the 2 documents here. One will be the Test (2) which has the offset tab i need to pull data from a file on my computer and the other is the file i need the data pulled from.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    bump..........

  11. #11
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    Okay so I've looked over what i had and decided to re-instate what i am needing this file to do. I have attached files to work with this time have some comparison files also.

    Main File : Test File 1

    I need all the work done on this workbook

    Raw Test Data Tab

    1. Need to select the command button labeled "Get Raw Data".
    2. Next need it to open a file on the computer and paste its values on this sheet identically.
    3. I have attached the files "Raw Test Data/Offset Data - Offset Data/Raw Test Data" to be loaded and pasted on to this sheet.

    Offset Data Tab

    1. Need to select the command button labeled "Get Offset Data".
    2. Next need it to open a file on the computer and paste its values on this sheet identically.
    3. I have attached the files "Raw Test Data/Offset Data - Offset Data/Raw Test Data" to be loaded and pasted on to this sheet.

    Sheet1 Tab

    1. For some reason i cannot change the name of this tab or it will mess up what is going on with this macro. If i could get the name change i would like to rename it "Final Data".
    2. Need to select the command button labeled "Get Test Data".
    3. Next need it to open a file on the computer and paste its values on this sheet identically.
    4. I have attached the files "Sheet1 Data 1 / Sheet1 Data 2" to be loaded and pasted on to this sheet.


    The problem i am having is getting each tab to load these files independently. Example : If i was to try and load a Offset file then it only changes what is on the Raw Test Data tab. The same thing goes for the command button on Sheet1, if i select a different file it only changes the Raw Test Data information. I had a lot of help with the code already so i am unsure of where the problem actually is. If someone could please take a look at this and help me out i would really appreciate this. If there is anything i can explain or i missed then please let me know.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    bump..............

  13. #13
    Registered User
    Join Date
    04-21-2014
    Location
    Lovington,NM
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Multiple Loading Data Command Buttons and Formulas using a macro.

    Could really use some help with this everyone. Any questions just ask.

+ 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] Merging multiple command buttons into one
    By antzint in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2013, 10:47 AM
  2. How do I hide multiple command buttons on one sheet
    By chillman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2013, 08:45 PM
  3. Multiple Command Buttons and One Macro?
    By ajocius in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2013, 03:26 AM
  4. Useform Code - 12 Command Buttons dependant on other command buttons
    By darrenkaye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2013, 10:58 AM
  5. Code to rationalise multiple command buttons in VBA
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2012, 07:48 AM
  6. Code for a master command button to change the backcolor of multiple command buttons?
    By panttherm5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:11 PM
  7. Code for multiple email command buttons
    By lpratt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2010, 01:39 PM
  8. Using same subroutine for multiple Command Buttons
    By tekman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2007, 02:57 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