It has been a while since I've done any work with macros and I am having a difficult time structuring a loop. I have the code that will allow the user to make an entry into this log, however I cannot struture the loop to allow for multiple entries.
I've pasted the code below.
Thanks.
Sub add()
I = 5
Dim etime
Dim esheet
Dim ecom
Dim filop
Dim acreboot
Dim lostwork
Dim count
Range("A" & I).Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("B" & I).Select
If Range("B" & I).Value = "" Then
etime = InputBox("Enter the time of the Error:")
ActiveCell.FormulaR1C1 = etime
End If
Range("C" & I).Select
If Range("C" & I).Value = "" Then
esheet = InputBox("Enter the sheet that was open when the Error occured:")
ActiveCell.FormulaR1C1 = esheet
End If
Range("D" & I).Select
If Range("D" & I).Value = "" Then
ecom = InputBox("Enter the command that caused the error:")
ActiveCell.FormulaR1C1 = ecom
End If
Range("E" & I).Select
If Range("e5").Value = "" Then
fileop = InputBox("Enter the number of files that were open when the crash occured:")
ActiveCell.FormulaR1C1 = fileop
End If
Range("F" & I).Select
If Range("F" & I).Value = "" Then
acreboot = InputBox("Enter the time in minutes it took to reboot AutoCAD:")
ActiveCell.FormulaR1C1 = acreboot
End If
Range("G" & I).Select
If Range("g5").Value = "" Then
lostwork = InputBox("Enter the amount of lost work time in minutes:")
ActiveCell.FormulaR1C1 = lostwork
End If
'Creates Border around most recent entry
Range("a" & I, "g" & I).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = 1
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = 1
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = 1
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = 1
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = 1
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
Bookmarks