Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default user form, set values

morning all.
My continuing saga of a user form.

I've made 10 comboboxes, and now that I've got the lists in them to be
populated via initialization (thank you JLGWhiz!), I need to start having the
combbox selections be input into a selected cell in a worksheet.

My previous user forms haven't used comboboxes (I used RefEdit boxes), so
I'm not sure if I use the same general code, or another set of terms.
In my previous user forms, I did:
-------------------------------------------------
Set MyRng3 = Nothing
On Error Resume Next
Set MyRng3 = Range(RefEdit3.Text)
On Error GoTo 0
If MyRng3 Is Nothing Then
Exit Sub 'user hit cancel.
End If

'and

myFormula3 = "=if(" & MyRng3.Address(rowabsolute:=False,
columnabsolute:=False, external:=True) & "=" _
& ACTotal & ",""ok""," & ACTotal & "-" & MyRng3.Address(rowabsolute:=False,
columnabsolute:=False, external:=True) & ")"

'where this was a formula that I input based on manual-cursor cell/range
'selections.

-------------------------------------------------------------------------
Now it seems like I need to do the following to get my desired input.
--------------------------------------------------------------------------------

Set myCell1 = Nothing
On Error Resume Next
Set myCell1 = Range(ComboBox1.value & Chr(10) & ComboBox2.value & Chr(10) &
ComboBox3.value & Chr(10) & ComboBox4.value)
On Error GoTo 0
If myCell1 Is Nothing Then
Exit Sub 'user hit cancel.
End If


ActiveCell.Select
myCell1 = myCell1
'and no, I'm not certain this last statement is correct.
----------------------------------------------------------
However... this did not work. So.... my question is:
what do I write here to input the values selected in my comboboxes into the
selected cell?

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default user form, set values

Something like this will put the value of your combo box into cell C10...
Range("C10").Value = Me.ComboBox1.Value

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Steve" wrote:

morning all.
My continuing saga of a user form.

I've made 10 comboboxes, and now that I've got the lists in them to be
populated via initialization (thank you JLGWhiz!), I need to start having the
combbox selections be input into a selected cell in a worksheet.

My previous user forms haven't used comboboxes (I used RefEdit boxes), so
I'm not sure if I use the same general code, or another set of terms.
In my previous user forms, I did:
-------------------------------------------------
Set MyRng3 = Nothing
On Error Resume Next
Set MyRng3 = Range(RefEdit3.Text)
On Error GoTo 0
If MyRng3 Is Nothing Then
Exit Sub 'user hit cancel.
End If

'and

myFormula3 = "=if(" & MyRng3.Address(rowabsolute:=False,
columnabsolute:=False, external:=True) & "=" _
& ACTotal & ",""ok""," & ACTotal & "-" & MyRng3.Address(rowabsolute:=False,
columnabsolute:=False, external:=True) & ")"

'where this was a formula that I input based on manual-cursor cell/range
'selections.

-------------------------------------------------------------------------
Now it seems like I need to do the following to get my desired input.
--------------------------------------------------------------------------------

Set myCell1 = Nothing
On Error Resume Next
Set myCell1 = Range(ComboBox1.value & Chr(10) & ComboBox2.value & Chr(10) &
ComboBox3.value & Chr(10) & ComboBox4.value)
On Error GoTo 0
If myCell1 Is Nothing Then
Exit Sub 'user hit cancel.
End If


ActiveCell.Select
myCell1 = myCell1
'and no, I'm not certain this last statement is correct.
----------------------------------------------------------
However... this did not work. So.... my question is:
what do I write here to input the values selected in my comboboxes into the
selected cell?

Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default user form, set values

Bingo....
Thank you Gary.
Have a great afternoon.



"Gary Brown" wrote:

Something like this will put the value of your combo box into cell C10...
Range("C10").Value = Me.ComboBox1.Value

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Steve" wrote:

morning all.
My continuing saga of a user form.

I've made 10 comboboxes, and now that I've got the lists in them to be
populated via initialization (thank you JLGWhiz!), I need to start having the
combbox selections be input into a selected cell in a worksheet.

My previous user forms haven't used comboboxes (I used RefEdit boxes), so
I'm not sure if I use the same general code, or another set of terms.
In my previous user forms, I did:
-------------------------------------------------
Set MyRng3 = Nothing
On Error Resume Next
Set MyRng3 = Range(RefEdit3.Text)
On Error GoTo 0
If MyRng3 Is Nothing Then
Exit Sub 'user hit cancel.
End If

'and

myFormula3 = "=if(" & MyRng3.Address(rowabsolute:=False,
columnabsolute:=False, external:=True) & "=" _
& ACTotal & ",""ok""," & ACTotal & "-" & MyRng3.Address(rowabsolute:=False,
columnabsolute:=False, external:=True) & ")"

'where this was a formula that I input based on manual-cursor cell/range
'selections.

-------------------------------------------------------------------------
Now it seems like I need to do the following to get my desired input.
--------------------------------------------------------------------------------

Set myCell1 = Nothing
On Error Resume Next
Set myCell1 = Range(ComboBox1.value & Chr(10) & ComboBox2.value & Chr(10) &
ComboBox3.value & Chr(10) & ComboBox4.value)
On Error GoTo 0
If myCell1 Is Nothing Then
Exit Sub 'user hit cancel.
End If


ActiveCell.Select
myCell1 = myCell1
'and no, I'm not certain this last statement is correct.
----------------------------------------------------------
However... this did not work. So.... my question is:
what do I write here to input the values selected in my comboboxes into the
selected cell?

Thank you.

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
Maintaing public array values in a user form Chet Excel Programming 1 October 4th 08 01:04 AM
User form return values Suhas Excel Programming 0 August 25th 07 08:18 PM
user form, saving values ophelia[_4_] Excel Programming 3 May 5th 06 12:47 PM
returning values from a User Form rohnds[_3_] Excel Programming 2 July 18th 04 04:59 PM
Cell Values On User Form gregork Excel Programming 10 February 3rd 04 03:51 PM


All times are GMT +1. The time now is 08:29 AM.

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"