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
Bookmarks