Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default User Form issues

I posted another user form question and I'm not sure it was posted as I got
an error message. As I'm a novice to user forms, I'm hoping this is easy to
the experts.

I have a user form where I want the user to enter the month and date using
combo boxes. I've gotten the combo boxes to work, but am not sure how to
pull the data back into the active worksheet. The name of the combo boxes
is cboMonth and cboYear. Can someone assist?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default User Form issues

you want one listbox with each month year combination?

With worksheets("Dates")
for each cell in .Range("B2:B32")
for each i = 1 to 12
useform1.listbox1.AddItem format(DateSerial(cell,i,1),"m/yy")
Next
Next
End with

then in you click event for the listbox

Private Sub Listbox1_click()
Dim s as String, iloc as Long, m as String, y as String
s= Listbox1.Value
iloc = Instr(1,s,"/",vbTextcompare)
m = Left(s,iloc-1)
y = "20" & Right(s,len(s)-iloc)
dt = DateSerial(clng(y),clng(m),1)
activecell.Value = dt
activecell.Numberformat = "m/yy"
End Sub

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

I posted another user form question and I'm not sure it was posted as I got
an error message. As I'm a novice to user forms, I'm hoping this is easy to
the experts.

I have a user form where I want the user to enter the month and date using
combo boxes. I've gotten the combo boxes to work, but am not sure how to
pull the data back into the active worksheet. The name of the combo boxes
is cboMonth and cboYear. Can someone assist?

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple User issues Mark W.[_2_] Excel Worksheet Functions 0 December 15th 08 09:03 PM
help! user form issues; can't find subroutines; appearance issue in-over-his-head-bill Excel Programming 3 July 6th 06 10:24 PM
User Form Initialize Event Issues Randy[_10_] Excel Programming 3 December 4th 05 11:20 AM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
Excel Form Issues...again :) BOHICA Excel Programming 3 June 29th 04 08:49 PM


All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"