PKennedyG77
New Member
- Joined
- Jan 2, 2016
- Messages
- 22
- Office Version
- 365
- Platform
- Windows
I have a very simple macro. (Apologies for title error, it is OK with F8 but not OK with F5)
The macro populates a cell which then refreshes the data.
I am then using end(xldown) to find the last row
When I step through this using F8 it works perfectly.
When I use F5 the data does not refresh until the macro is complete and therefore the wrong row is found
Macro is below
The macro populates a cell which then refreshes the data.
I am then using end(xldown) to find the last row
When I step through this using F8 it works perfectly.
When I use F5 the data does not refresh until the macro is complete and therefore the wrong row is found
Macro is below
Code:
Sub RefreshData()
Dim w As Integer
Dim r As Integer
w = InputBox("What week number are you enquiring about." & vbNewLine & " Current Week is " & Range("r2") & "")
Range("G2") = w
ActiveWorkbook.RefreshAll
r = Range("C6").End(xlDown).Row
MsgBox r
End Sub
Last edited by a moderator: