On the attached, the cmdbNextRecord Sub produces and error and I am not sure why. Thank you for your assistance. Asset-Register---8-14-15.xlsm
Microsoft ExcelVisual Basic ClassicVBA
Last Comment
mcarsonsr
8/22/2022 - Mon
GrahamSkan
You have declared rData as a Range type, but it is uninstantiated - i.e. you haven't set it to any particular range.
Option ExplicitDim ws As WorksheetDim rData As RangeDim lRw As LongPrivate Sub cmdbNextRecord_Click() If lRw = rData.Rows.Count - 1 Then MsgBox "You have selected the last record", vbCritical, "Cancel" Exit Sub Else: lRw = lRw + 1 LoadBoxes End IfEnd Sub
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
mcarsonsr
ASKER
Hi,
Thank you. I have tried to define the range, but I still receive the run time error shown in the attached screen print. I am very new to VBA. Please advise and thank you. The Excel workbook is attached.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Open in new window