+ Reply to Thread
Results 1 to 4 of 4

Automate extracting data from multiple spreadsheets of different value representations

  1. #1
    Registered User
    Join Date
    11-11-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    8

    Automate extracting data from multiple spreadsheets of different value representations

    Hello, I am wondering, If i get an excel spreadsheet with the headers being the same but the data in it will change (for example, say we have KG, G, Ounces as a title, and values to represent object weights in each cell. but i get a new sheet every hour with different values for those respective cells) Is there a way to create a Macro for this? These values will constantly be changing every day.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Automate extracting data from multiple spreadsheets of different value representations

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    11-11-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    8

    Re: Automate extracting data from multiple spreadsheets of different value representations

    Ahh sorry, thank you for the advice, I am uploading a mock of the data before and after. Just know that there are multiple copies of the "before" but will have different values for each "before".
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-11-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    8

    Re: Automate extracting data from multiple spreadsheets of different value representations

    Actually I figured out majority of my code but however I am struggling to Transpose the data to horizontal. My code as of right now, is this:

    Sub ImportDatafromotherworksheet()
    Dim wkbCrntWorkBook As Workbook
    Dim wkbSourceBook As Workbook
    Dim rngSourceRange As Range
    Dim rngDestination As Range
    Set wkbCrntWorkBook = ActiveWorkbook
    With Application.FileDialog(msoFileDialogOpen)
    .Filters.Clear
    .Filters.Add "Excel 2007-13", "*.xlsx; *.xlsm; *.xlsa"
    .AllowMultiSelect = False
    .Show
    If .SelectedItems.Count > 0 Then
    Workbooks.Open .SelectedItems(1)
    Set wkbSourceBook = ActiveWorkbook
    Set rngSourceRange = Application.InputBox(prompt:="Select source range", Title:="Source Range", Default:="A1", Type:=8)
    wkbCrntWorkBook.Activate
    Set rngDestination = Application.InputBox(prompt:="Select destination cell", Title:="Select Destination", Default:="A1", Type:=8)
    rngSourceRange.Copy rngDestination
    rngDestination.PasteSpecial Transpose:=True

    wkbSourceBook.Close False
    End If
    End With
    End Sub


    I made the code that is wrong bold. I know it is how i am wording the pasteSpecial but every other way I have done it, is not working out to be correct.

+ 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. Replies: 2
    Last Post: 10-29-2018, 01:48 PM
  2. Using VBA to automate copying of data from master sheet to linked spreadsheets
    By suedavies in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2015, 03:55 PM
  3. Automate Advanced Filter / VBA to split data to new spreadsheets
    By Jasbels in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2015, 09:43 AM
  4. Link and Automate(update) Template with data from different spreadsheets
    By AnaM21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2014, 05:25 AM
  5. Automate extracting data based on existing data
    By krishnapunekar in forum Excel General
    Replies: 1
    Last Post: 07-18-2011, 08:18 AM
  6. Extracting data from two different spreadsheets into one
    By Deepika in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-08-2010, 11:05 AM
  7. Is it possible to automate merging data between multiple spreadsheets?
    By No_expert in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2005, 07:42 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