Morning
I have a macro, can some one please help me change it and write the code to check if the macro have run before when the button is pressed
if it has please return a message saying sorry this has be run before. then end the macro
my thoughts were to have a look and see if anything was in cell """" Destination:=Sheets("P1").Range("A13")) ""
if not run the macro
many thanks jason
I have a macro, can some one please help me change it and write the code to check if the macro have run before when the button is pressed
if it has please return a message saying sorry this has be run before. then end the macro
my thoughts were to have a look and see if anything was in cell """" Destination:=Sheets("P1").Range("A13")) ""
if not run the macro
many thanks jason
Code:
Sub GetWebPage_P1()
'Copy web page
On Error GoTo error
Application.ScreenUpdating = False
With Sheets("P1").QueryTables.Add(Connection:= _
"URL;" & Sheets("Data").Range("B22").Value, _
Destination:=Sheets("P1").Range("A13"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
Sheets("Test").Activate
Range("L12:Y764").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("P1").Select
Range("L13").Select
ActiveSheet.Paste
Columns("L:L").ColumnWidth = 16.83
Columns("V:V").ColumnWidth = 14.5
Range("A1").Select
error:
Application.ScreenUpdating = True
End Sub