+ Reply to Thread
Results 1 to 14 of 14

Need to automatically transfer data from survey sheet to paste sheet.

  1. #1
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Exclamation Need to automatically transfer data from survey sheet to paste sheet.

    hey anthony, i just received another email from the big wigs of my office. they added another workbook(CO-120030 Surveys), but the lucky thing is it is the same as the calculated survey workbook, but the difference is im going to be putting my info in that workbook(CO-120030 Surveys) first then to the calculated then to the Paste workbook with the two sheets(directional only, and gamma string). so i need to put the macro in the CO-120030 workbook so it transfers to the calculated workbook then to the Paste workbook. here is the code u sent me. can u alter it so i enter the data on the CO-120030 workbook and have it automatically sends to the Calculated workbook then to the Paste workbook.
    Here is the macro u made for me -
    macro4.txt
    Calculated.xlsx
    CO-120030 Surveys.xlsm
    Last edited by MWD Hand; 01-30-2012 at 12:17 AM.

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    Add this code to a module and run it once the data has been pasted into the Survey Workbook (which will need to be saved as an Macro Enabled Workbook xlsm) - it will check to see if Paste.xlsx is open or not and if it is not open it will open the file.
    Please Login or Register  to view this content.
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  3. #3
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    hey smuzoen, thats awesome!!! but one problem, when i enter the survey on the survey sheet it sends the data to the paste sheet as planned, but on a different row. i would like it to replace the data in row 3(cells C3 thru K3) everytime. also when i enter survey after survey on the survey sheet the macro sends it to the paste sheet and keep all the surveys enter in a running talley. i would like to only have the last entered survey on the Paste sheet and only the last instead of the running talley. i really appreciate the time and effort your putting in. thank you

  4. #4
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    Just change the code to this - this will always post the survey results to C3
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    thanks a million Anthony. i hate to bother you again, i have two sheets on the paste workbook now and how hard would it be to set both of them to automatically update. and what about adding another workbook to do the same function. do i use Set wBook = Workbooks (Calculated.xlsx"). thats the other workbook i want to auto update.

  6. #6
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    It depends where the data is coming from and going to. If I assume correctly you care copying data from Calculated.xlsx to the second sheet of the Paste workbook? You could do it all with one macro enabled workbook or if you don't necessarily want to update both books simultaneously then you could replicate the code above. The change you have to make is the destination where you want the data pasted into the Paste workbook - you have to define the sheet you want the data copied into.
    Please Login or Register  to view this content.
    So you could use the code above to copy data from Surveys to Sheet 1 of the paste workbook. Then copy this code and place it into the Calculated workbook (which will now need to be a macro enabled workbook) and you would need to make sure you change it to paste the data into the correct sheet of the Paste workbook (I will assume Sheet2)
    Please Login or Register  to view this content.
    If you want to copy data from Calculated.xlsx and Surveys.xlsm at the same time you could easily change the code so you could do all the work in 1 macro in Surveys.xlsm. Do you want both Paste sheets updated at the same time i.e. Data from Surveys copied to Sheet1 of Paste and Data from Calculated to Sheet2 of Paste workbook.?If you cannot work out the steps from the information above then if you spell out exactly what data is going to which sheets from which workbook - be very specific - I will rewrite the code however be VERY VERY specific about what data is going from where (original data) to where (destination). You will have it clear in your mind however I need to be clear if you need further help.
    I hope this makes sense - just ask if you need help.
    Last edited by smuzoen; 01-24-2012 at 05:32 AM.

  7. #7
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    the sheets i have named them Directional Only and Gamma String. ive tried to enter them in the code like this ("Directional Only")(Gamma String") but its not workin. i think its because the format im using. whats the proper way to put it in.

  8. #8
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    If these are the sheets you are pasting into
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    hey i appreciate all that uve done for me. i got it up and going. made my job a whole lot easier. thanks again

  10. #10
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    hey anthony, i just received another email from the big wigs of my office. they added another workbook(CO-120030 Surveys), but the lucky thing is it is the same as the calculated survey workbook, but the difference is im going to be putting my info in that workbook(CO-120030 Surveys) first then to the calculated then to the Paste workbook with the two sheets(directional only, and gamma string). so i need to put the macro in the CO-120030 workbook so it transfers to the calculated workbook then to the Paste workbook. here is the code u sent me. can u alter it so i enter the data on the CO-120030 workbook and have it automatically sends to the Calculated workbook then to the Paste workbook.
    i updated the post

  11. #11
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    Hey there
    I have just changed the code you sent (as I assumed it was working for the Paste component for the 2 worksheets) so I just added the copy to Calculated.xlsx. I have changed the code so it only copies values and not the formats. If the code needs to be changed at all just let me know. I have added the code to CO-120030 Surveys.xlsm workbook.
    PS: You may just need to alter the location of the Calculated.xlsx workbook and the sheet name where data gets pasted. I assumed is getting pasted to last available row in Calculated.xlsx
    Hope this helps.
    Anthony
    “Confidence never comes from having all the answers; it comes from being open to all the questions.”
    PS: Remember to mark your questions as Solved once you are satisfied and rate the answer(s) questions.”
    Attached Files Attached Files
    Last edited by smuzoen; 01-26-2012 at 04:07 AM.

  12. #12
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    ill be working on it later on in the night but ill let u know how its going. thanks for everything

  13. #13
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    hey there Anthony, the code worx pretty darn good, except one problem. the workbook jsoto.xlsx with the two sheets (gamma string) and (directional only), the data automatically transfers to the gamma sheet but not the directional sheet. i looked at the code but cant see any problems.

    Sub justinsoto()
    Dim ws1 As Worksheet
    Set ws1 = Worksheets("Survey Sheet")
    ws1.Range("A" & ws1.Cells(Rows.Count, "B").End(xlUp).Row & ":I" & ws1.Cells(Rows.Count, "B").End(xlUp).Row).Copy
    On Error Resume Next
    Set wBook = Workbooks("jsoto.xlsx")
    If wBook Is Nothing Then
    Workbooks.Open Filename:="C:\Users\Robert\Desktop\jsoto.xlsx"
    Worksheets("Gamma String").Range("C" & Cells(Rows.Count, "C").End(xlUp).Row).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Worksheets("Directional Only").Range("C" & Cells(Rows.Count, "C").End(xlUp).Row).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Set wBook = Nothing
    On Error GoTo 0
    Else
    Windows("jsoto.xlsx").Activate
    Worksheets("Gamma String").Range("C" & Worksheets("Gamma String").Cells(Rows.Count, "C").End(xlUp).Row).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Worksheets("Directional Only").Range("C" & Worksheets("Directional Only").Cells(Rows.Count, "C").End(xlUp).Row).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End If
    ws1.Range("A" & ws1.Cells(Rows.Count, "B").End(xlUp).Row & ":I" & ws1.Cells(Rows.Count, "B").End(xlUp).Row).Copy
    On Error Resume Next
    Set wBook = Workbooks("Whitfield_West_Unit_#1H_Calculated Surveys.xls")
    If wBook Is Nothing Then
    Workbooks.Open Filename:="G:\CO-120030\Survey's Folder\Whitfield_West_Unit_#1H_Calculated Surveys.xls" ' or location of Calculated.xls
    Worksheets("Sheet1").Range("A" & Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Set wBook = Nothing
    On Error GoTo 0
    Else
    Windows("Whitfield_West_Unit_#1H_Calculated Surveys.xls").Activate
    Worksheets("Sheet1").Range("A" & Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End If
    End Sub

  14. #14
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    Please Login or Register  to view this content.
    The main reason why this will fail is if there is any misspelling or spaces in the sheet name - there is nothing wrong with the code. For sake of argument change the Directional Only sheet to say "abc" and change the code to reflect the name change and run it again - I am sure it will be a matter of spelling. You could use the index number of the sheet so make it
    Please Login or Register  to view this content.
    Where 2 is the index number of the sheet - in the top left hand corner of the VB editor you will see the sheet number

    PS: Make sure you post your code with code tags

  15. #15
    Registered User
    Join Date
    01-21-2012
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need to automatically transfer data from survey sheet to paste sheet.

    I got it, finally!!! Thanks for all your help Anthony. I appreciate it. Again thanks

+ 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