tobyz95
Board Regular
- Joined
- Jul 28, 2012
- Messages
- 190
Hello ALL, I have been using this macro for years and it has just stopped working and I cannot figure out why.
any help would be greatly appreciated.
any help would be greatly appreciated.
VBA Code:
Dim LastFilledCell As Range
Set LastFilledCell = Range("K76:K80").Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues)
If LastFilledCell Is Nothing Then
Range("K76").Value = "2000"
ElseIf LastFilledCell.Row < 81 Then
LastFilledCell.Offset(1) = "2000"
Else
MsgBox "Range is completely filled!"
End If
End Sub
YearlyBudget2023.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
K | L | M | N | O | P | Q | |||
1 | 200.00 | ||||||||
2 | 100.00 | ||||||||
3 | 1,000.00 | ||||||||
4 | 15.00 | ||||||||
5 | 500.00 | I want the next amount to go to L5, M5,N5 if necessary | |||||||
6 | I have a control button that adds a figure so if the five rows get filled when I have to hit the control button, the figure is placed in the next open cell to the right in that row | ||||||||
7 | |||||||||
8 | |||||||||
9 | |||||||||
10 | |||||||||
NOVEMBER |