I have text that is copied to a worksheet called "Master" which has formulae to extract the data from Cells L1:GX5000. It doesn't often use 5000 rows but that is dependent on how much is on the web page being copied to the Master sheet.
When the Macro fires it copies this data to another worksheet which is given a name as appears in L1 cell plus it clears everything from the Master sheet ready for the next web page to be copied and pasted.
Then the process begins all over again.
The Macro used to take about 8-9 seconds to do this but recently it's taking 28-29 seconds but I can't work out why all of a sudden.
Logic tells me it's not the code as it would have been behaving like this all of the time???
Could someone please have a look and see what they think of the code and maybe a way to speed it up please.
[/CODE]
I hope this code has formatted properly, oh and I did not write the code, not clever enough for that.
When the Macro fires it copies this data to another worksheet which is given a name as appears in L1 cell plus it clears everything from the Master sheet ready for the next web page to be copied and pasted.
Then the process begins all over again.
The Macro used to take about 8-9 seconds to do this but recently it's taking 28-29 seconds but I can't work out why all of a sudden.
Logic tells me it's not the code as it would have been behaving like this all of the time???
Could someone please have a look and see what they think of the code and maybe a way to speed it up please.
VBA Code:
Sub Create()
Dim ws As Worksheet
Sheets("Form").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(1, 1).Value = _
Sheets("Master").Range("L1").Value
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set wh = Worksheets(ActiveSheet.Name)
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
If wh.Range("L1").Value <> "" Then
ActiveSheet.Name = wh.Range("L1").Value
End If
wh.Activate
Range("A1:K3000").ClearContents
Range("A1").Select
Sheets("Master").Range("A1").Select
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub[CODE=vba]
I hope this code has formatted properly, oh and I did not write the code, not clever enough for that.