Hi,
I have 2 new questions this time. I will post one Q here and other in another post since these are two different things
Hope you people can help me.
The below is my macro
PHP Code:
Option Explicit
Sub cmdUpdate_Click()
On Error GoTo ErrHandler
Dim aError, aFiles, i As Integer
With Application
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
End With
'check for files:
For i = LBound(aFiles) To UBound(aFiles)
If Dir(ThisWorkbook.Path & "\" & aFiles(i)) = vbNullString Then
strError = strError & vbLf & "File not found: '" & aFiles(i) & "'."
End If
Next i
If strError <> vbNullString Then GoTo ErrHandler
With ThisWorkbook
GetFromWorkbook .Worksheets("Liq Fil"), "R.0011358_LF_Design Support CF -Air_Liquid_PCR (Liq Fil)_MSR.xlsx"
GetFromWorkbook .Worksheets("Singapore"), "R.0007420_Singapore_MSR.xlsx"
GetFromWorkbook .Worksheets("Houston"), "R.0007440_DBU Houston_MSR.xlsx"
.Worksheets("DU Dashboard").Activate
Sheet23.CreatePowerPoint
End With
ErrHandler:
If strError <> vbNullString Then
frmError.lstError.Clear
aError = Split(strError, vbLf)
For i = LBound(aError) + 1 To UBound(aError)
frmError.lstError.AddItem aError(i)
Next i
frmError.Show
End If
With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With
If Err.Number <> 0 Then
MsgBox Err.Number & ": " & Err.Description
End If
End Sub
In this as you can see, the file names in the below section
are hard coded. I would like to have it take those data from a list like in the attached excel sheet. I am planning to have the tab containing this list in the file where this macro is, So no external file reference here also. How to do that? Tried some solutions available in net. But failed. Please help
Please make the Post as solved, when you get your answer & Click * if you like my suggestion
Re: Getting the array list to from the file itself
Hi,
Sorry, The code that you gave is giving some error. I am uploading the actual files for your convinience. Hope this will be helpful
What this macro does/needs to do is, it will open the MSR files and copy paste the value (not formulas) which is given in Consolidated MSR to the relevant tabs in the Consolidated MSR file.
I have added the tab 'DataSheet' and listed the files and the tabs in the consolidated file in to which the data should be pasted as per the suggestion given by you.
Re: Getting the array list to from the file itself
Sorry, my mistake.
I left some extra empty columns in the table. When I removed that, the problem got solved.
Really Sorry....
Thanks again for your support.
I tried to add reputation to your profile. But getting the message that, you need to spread some reputation around before giving again. Will try again in 2 days.
When you get time, can you pls have a look at this also?
Bookmarks