Hi everyone, I'm not very VB savy and I'm looking for some help improving some macros that I use. Right now the macro that I use to refresh a group of sheets looks something like the following:
-----------------------------------------------------------
Declare Function EssVRetrieve Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal range As Variant, ByVal lockFlag As Variant) As Long
___________________________________________________________
Sub RefCompData()
X = EssVRetrieve("sheet 1", Null, 1)
X = EssVRetrieve("sheet 2", Null, 1)
X = EssVRetrieve("sheet 3", Null, 1)
If X = 0 Then
MsgBox ("REFRESH SUCCESSFUL")
Else
MsgBox ("REFRESH FAILED - TRY AGAIN")
End If
Calculate
End Sub
-----------------------------------------------------------
I want to find a way to refresh the range of sheets rather than listing each sheet individually in the macro. As it is now we have to go in and change the macro whenever we add or remove a sheet. If I could right a macro which would recognize the range of sheets rather than each sheet on its own that would be great. Thanks alot everyone.
Brandon
-----------------------------------------------------------
Declare Function EssVRetrieve Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal range As Variant, ByVal lockFlag As Variant) As Long
___________________________________________________________
Sub RefCompData()
X = EssVRetrieve("sheet 1", Null, 1)
X = EssVRetrieve("sheet 2", Null, 1)
X = EssVRetrieve("sheet 3", Null, 1)
If X = 0 Then
MsgBox ("REFRESH SUCCESSFUL")
Else
MsgBox ("REFRESH FAILED - TRY AGAIN")
End If
Calculate
End Sub
-----------------------------------------------------------
I want to find a way to refresh the range of sheets rather than listing each sheet individually in the macro. As it is now we have to go in and change the macro whenever we add or remove a sheet. If I could right a macro which would recognize the range of sheets rather than each sheet on its own that would be great. Thanks alot everyone.
Brandon