Hi Guys,
I currently have the following macro which works a treat however I wanted to add to it and Im not sure where to start.
As you can probably tell by reading the above that I am importing data from other sheets located on a network drive, It creates a new sheet within the workbook and imports that data in.
The next step that I would like to implement into this is that,
Once teh sheet is created, I would like to to Paste a set of data and formulas
as follows.
M7 = "Enow Office"
M8 = "Enow Director"
M9 = "EPS"
M10 = "HLT - Kristy"
M11 = "HLT - Heath(1)"
M12 = "HLT - Heath(2)"
M13 = "PSM"
M14 = "Switch"
M15 = "TwoWay Office"
M16 = "TwoWay Director"
N7 through N16 is a set of values to look up for.
O7 through O16 is a series of formulas
What would be the best way to approach this??
I currently have the following macro which works a treat however I wanted to add to it and Im not sure where to start.
Rich (BB code):
Sub Consolidate()
'Open all Excel files in a specific folder and import data as separate sheets
'JBeaucaire (7/6/2009) (2007 compatible)
Dim strFileName As String, strPath As String, sName As String
Dim wbkOld As Workbook, wbkNew As Workbook, ws As Worksheet
'Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Set wbkNew = ThisWorkbook
strPath = "\\ia-sbs2008\tggs\reports\phone reports\Daily Outbound Trace\"
strFileName = Dir(strPath & "*.xl*")
wbkNew.Activate
'Import first active sheet from found file
Do While Len(strFileName) > 0
Set wbkOld = Workbooks.Open(strPath & strFileName)
sName = Left(strFileName, InStr(strFileName, ".") - 1)
Sheets("Data Sheet").Name = sName
Sheets(sName).Copy After:=wbkNew.Sheets(wbkNew.Sheets.Count)
strFileName = Dir
wbkOld.Close False
Loop
Application.DisplayAlerts = True
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
As you can probably tell by reading the above that I am importing data from other sheets located on a network drive, It creates a new sheet within the workbook and imports that data in.
The next step that I would like to implement into this is that,
Once teh sheet is created, I would like to to Paste a set of data and formulas
as follows.
M7 = "Enow Office"
M8 = "Enow Director"
M9 = "EPS"
M10 = "HLT - Kristy"
M11 = "HLT - Heath(1)"
M12 = "HLT - Heath(2)"
M13 = "PSM"
M14 = "Switch"
M15 = "TwoWay Office"
M16 = "TwoWay Director"
N7 through N16 is a set of values to look up for.
O7 through O16 is a series of formulas
What would be the best way to approach this??