CONSOLIDATE DATA FROM MULTIPLE SHEETS IN ONE

S

Sinner

Hi,

After I import multiple text files in excel in seperate sheets in same
workbook, I want to consolidate them in one sheet. First row of each
sheet has same headers so during data merge it should not get first
row of sheet2, sheet3, sheet4.

I want to run this macro seperately from first macro i.e. import text
files so that I can first check all sheets for proper data integrity
manually.

Any help would be appreciated.
 
S

SCrowley

I created a sheet called Combined Sheets, cell A2 and clicked on Macros and
ran this one. It combines the A2 cells in sheets 1, 2, and 3. Fills formula
Down to (row 285), copies all cells highlighted and pastes just the values.
Hopes this helps.

Sub combineall()
'
' combineall Macro
'

'
ActiveCell.FormulaR1C1 = "=Sheet1!RC&"" ""&Sheet2!RC&"" ""&Sheet3!RC"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A285"), Type:=xlFillDefault
Range("A2:A285").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top