ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Visual Basic Programming Difficulties with linking Userforms (https://www.excelbanter.com/excel-programming/273638-visual-basic-programming-difficulties-linking-userforms.html)

Chuckie

Visual Basic Programming Difficulties with linking Userforms
 
Alrighty, I have bought 3 VBA books, and none have been
able to answer my questions. So, any help from anyone would be most
helpful. I also must apologize in advance since I cannot copy my code
into this window; I am currently not using my computer that has the
file stored on it.

1) In VBA, I have created two userforms: userform1 and
userform2. On Userform1 I created a couple of
commandbuttons. However, my codes are incorrect for
linking those commandbuttons to Userform2. Basically,
when I click on the commandbuttons I want it to show
Userform2. Does anyone know how to do this?
2) In addition, in VBA, I have created some listboxes on
my userform3. However, I wanted to link that list box to
a range of cells in my worksheet, and in addition, filter
out redundant numbers. Does anyone know how I may
approach this and possible code solutions?

Thank you for your time =)

Tom Ogilvy

Visual Basic Programming Difficulties with linking Userforms
 
Private Sub CommandButton1_click()
me.hide
Userform2.show
End Sub

There isn't any type of link that would remove redundant entries. You would
need to build a unique list and populate the box

See John Walkenbach's site for sample code:

http://j-walk.com/ss/excel/tips/tip47.htm

--
Regards,
Tom Ogilvy


Chuckie wrote in message
om...
Alrighty, I have bought 3 VBA books, and none have been
able to answer my questions. So, any help from anyone would be most
helpful. I also must apologize in advance since I cannot copy my code
into this window; I am currently not using my computer that has the
file stored on it.

1) In VBA, I have created two userforms: userform1 and
userform2. On Userform1 I created a couple of
commandbuttons. However, my codes are incorrect for
linking those commandbuttons to Userform2. Basically,
when I click on the commandbuttons I want it to show
Userform2. Does anyone know how to do this?
2) In addition, in VBA, I have created some listboxes on
my userform3. However, I wanted to link that list box to
a range of cells in my worksheet, and in addition, filter
out redundant numbers. Does anyone know how I may
approach this and possible code solutions?

Thank you for your time =)




Mike[_37_]

Visual Basic Programming Difficulties with linking Userforms
 
If you use a "scratch" sheet which some people use, like a hidden sheet for
storing information, etc, you could also use AdvancedFilter ala something
like:

Range("Y3:Y11").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"AJ2"), Unique:=True

in order to get yourself a unique list of numbers, and then populate your
list box from your new range.

Mike.
__________________________________________________ __________________________
________________
Please reply to newsgroup so everyone can benefit.
Email address is not valid (see sparkingwire.com)
__________________________________________________ __________________________
________________

"Tom Ogilvy" wrote in message
...
Private Sub CommandButton1_click()
me.hide
Userform2.show
End Sub

There isn't any type of link that would remove redundant entries. You

would
need to build a unique list and populate the box

See John Walkenbach's site for sample code:

http://j-walk.com/ss/excel/tips/tip47.htm

--
Regards,
Tom Ogilvy


Chuckie wrote in message
om...
Alrighty, I have bought 3 VBA books, and none have been
able to answer my questions. So, any help from anyone would be most
helpful. I also must apologize in advance since I cannot copy my code
into this window; I am currently not using my computer that has the
file stored on it.

1) In VBA, I have created two userforms: userform1 and
userform2. On Userform1 I created a couple of
commandbuttons. However, my codes are incorrect for
linking those commandbuttons to Userform2. Basically,
when I click on the commandbuttons I want it to show
Userform2. Does anyone know how to do this?
2) In addition, in VBA, I have created some listboxes on
my userform3. However, I wanted to link that list box to
a range of cells in my worksheet, and in addition, filter
out redundant numbers. Does anyone know how I may
approach this and possible code solutions?

Thank you for your time =)







All times are GMT +1. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com