Home

Macros and Programming

 

CardboxForumsMacros and Programming > "Extract Data From Another Excel Workbook"

Extract Data From Another Excel Workbook

Extracting Data From Another Excel Workbook (Auto populating)

Current user: [none]
Register / Log In · Help

Posted By Post

tckelley85

24-Dec-2014 18:03

Hello,

I am trying to extract data from an audit report into another workbook through VBA. Im trying to create a macro that can do this. So for example, the “master workbook” looks something like this:

SCH.3 line 120 col.5 35,062 53,390 31,930
SCH.3 line 120 col.10 132,117 199,281
SCH.4 line 120 col.5 132,270 162,047
SCH.4 line 120 col.10 11,310 17,762
SCH.5 line 120 col.V 132,825 432,928
SCH.5 line 120 col.5 0 0
SCH.5 line 120 col.10 0 0

The missing part is where I want to automatically pull data from this other worksheet into these cells referenced above. For example the 31,930 is located on another spreadsheet in sheet "SCH.3" line 120 col.5. Here's what I figured out so far...

Sub AbstractData()
'
' AbstractData Macro
'

'
Workbooks.Open ("C:\Users\...")
Sheets("Sheet 1").Select
Range("D41").Select
Selection.Copy
Windows("WORKSHEET").Activate
Range("D4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Workbooks.Open ("C:\Users\...")
Sheets("Sheet 1").Select
Range("E41").Select
Selection.Copy
Windows("WORKSHEET").Activate
Range("D5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Ok so I was able to copy paste from one workbook into another workbook. However, now I would like to create a way to "loop" so it can grab from multiple spreadsheets. For example, I will get five individual reports where I need to extract that data from all these reports into a "master workbook". Please help. Thanks.

bert

24-Dec-2014 18:29

You could try to find an Excel forum...

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home