Range question

JessyVal

New Member
Joined
Feb 23, 2021
Messages
30
Office Version
  1. 365
Hi, I have a question, I hope I can explain my self clearly

I have a form called userform1, this form is to show information about people , I can find them by id or by name, I can modify information from that form. As you can see, beside volunteer name box, there are two search buttons, if you click in the second search button a second user form is going to be displayed.

1618836162302.png
1618831669356.png



This is the second form, the porpuse of this second form is that in case the user is not sure about the id, or there are many people with the same name, he can pick which register is the one that he wants to update. The main idea is that the user click in the id, then click in Modificar (modify) and what I spected is that the first User form will be displayed with the info of the person that the user want to modify.

1618831758291.png


The issue that I am having now, is that once I click in the id and then press modificiar I got this error

1618831975674.png



this is the code that i have in the buttom Modificar (modify)

Private Sub CommandButton3_Click()
If Me.ListBox1.ListIndex < 0 Then
MsgBox "You haven't selected any record"
Else
UserForm1.Show
End If

End Sub

I hope I was able to explain myself
 

Attachments

  • 1618836153312.png
    1618836153312.png
    31.2 KB · Views: 21

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You are getting that error because you have a "." in front of the word "Range" in ".Range("A1")".
Remove this period. You would only use ".Range" within a "With" clause, which you are not.
If it is not within a "With" clause, it would just be "Range"
 
Upvote 0
You are getting that error because you have a "." in front of the word "Range" in ".Range("A1")".
Remove this period. You would only use ".Range" within a "With" clause, which you are not.
If it is not within a "With" clause, it would just be "Range"
It works! thankyou so much!
 
Upvote 0
You are welcome.
Glad I was able to help!
:)
 
Upvote 0
It means that your form is already displayed, so you can't show it again.

This is also a different question really and should be posted as such.
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,431
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top