bharmsen21
New Member
- Joined
- Dec 6, 2017
- Messages
- 1
I would like to refresh my workbook when I click on the refresh button that I put in my workbook no matter what. Right now the code I have with the refresh button is
Sub logs()
Dim Sht As Worksheet
Dim checkRange As Range, CheckCell As Range
For Each Sht In ThisWorkbook.Sheets
With Sht
Select Case .Name
Case "Final Four", "Top Left", "Bottom Left", "Top Right", "Bottom Right"
Set checkRange = .Range("A1:Z100") ' set the range for the current sheet
For Each CheckCell In checkRange
If IsError(CheckCell) Then If CheckCell = CVErr(2023) Then Exit Sub
Next CheckCell
Case Else
' do nothing
End Select
End With
Next Sht
ActiveSheet.EnableCalculation = True
lst = Sheets("data").UsedRange.Rows.Count
x = lst + 1
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
Sheets("data").Range("A" & x) = ActiveSheet.Range("I3")
Sheets("data").Range("B" & x) = ActiveSheet.Range("I4")
End Sub
Which only lets me refresh the workbook when there is no error. I would just like my code to run if there is no error but still be able to refresh the page
Sub logs()
Dim Sht As Worksheet
Dim checkRange As Range, CheckCell As Range
For Each Sht In ThisWorkbook.Sheets
With Sht
Select Case .Name
Case "Final Four", "Top Left", "Bottom Left", "Top Right", "Bottom Right"
Set checkRange = .Range("A1:Z100") ' set the range for the current sheet
For Each CheckCell In checkRange
If IsError(CheckCell) Then If CheckCell = CVErr(2023) Then Exit Sub
Next CheckCell
Case Else
' do nothing
End Select
End With
Next Sht
ActiveSheet.EnableCalculation = True
lst = Sheets("data").UsedRange.Rows.Count
x = lst + 1
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
Sheets("data").Range("A" & x) = ActiveSheet.Range("I3")
Sheets("data").Range("B" & x) = ActiveSheet.Range("I4")
End Sub
Which only lets me refresh the workbook when there is no error. I would just like my code to run if there is no error but still be able to refresh the page