Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Insert value in text box based on previous tselected value.

Oh Wise Ones,

The first block on this user forms allows me to select the product based on
1 of 3 radio button selections.

Sub EnterData_Click()
Worksheets("Open Red Tags").Activate
Worksheets("Open Red Tags").Rows(4).Insert
If TL30.Value = True Then
Worksheets("Data").Range("A2").Copy
ActiveSheet.Paste Destination:=Worksheets("Red Tag").Range("D6,D32")
Worksheets("Data").Range("C2").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red Tags").Range("D4")
End If
If TL40.Value = True Then
Worksheets("Data").Range("A3").Copy
ActiveSheet.Paste Destination:=Worksheets("Red Tag").Range("D6,D32")
Worksheets("Data").Range("C3").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red Tags").Range("D4")
End If
If TLLT.Value = True Then
Worksheets("Data").Range("A4").Copy
ActiveSheet.Paste Destination:=Worksheets("Red Tag").Range("D6,D32")
Worksheets("Data").Range("C4").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red Tags").Range("D4")

Then it calls a text box that always displays a Default value of 12. It
would be nice to have the "12" replaced by either 12 if TL30 is selected, 9
if TL40 is selected, or 6 if TLLT is selected.

Dim Message, Title, Default, Squares
Dim TagNumber As Integer

Message = "Enter the number of squares for this tag" ' Set prompt.
Title = "Squares" ' Set title.
Default = "12" ' Set default.
' Display message, title, and default value.
Squares = InputBox(Message, Title, Default)

How can I replace the 12 with the selected product reference number?

Thanks,
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Insert value in text box based on previous tselected value.

'Im making some assumptions based on what I see but . . . . (example is not
checked for correctness it's just a basic sample) . .. it looks like you
could . . .

Dim Message, Title, Default, Squares
Dim TagNumber As Integer
Message = "Enter the number of squares for this tag" ' Set prompt.
Title = "Squares" ' Set title.

'ADD THIS to SET Default
IF TL30.Value = True Then
Default = "12"
ElseIF TL40.Value = True Then
Default = "9"
ElseIF TLLT.Value = True Then
Default = "6"
Else 'Unknow value so assume 12
Default = "12"
End if

' Display message, title, and default value.
Squares = InputBox(Message, Title, Default)



"Mike K" wrote in message
...
Oh Wise Ones,

The first block on this user forms allows me to select the product based
on
1 of 3 radio button selections.

Sub EnterData_Click()
Worksheets("Open Red Tags").Activate
Worksheets("Open Red Tags").Rows(4).Insert
If TL30.Value = True Then
Worksheets("Data").Range("A2").Copy
ActiveSheet.Paste Destination:=Worksheets("Red
Tag").Range("D6,D32")
Worksheets("Data").Range("C2").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red
Tags").Range("D4")
End If
If TL40.Value = True Then
Worksheets("Data").Range("A3").Copy
ActiveSheet.Paste Destination:=Worksheets("Red
Tag").Range("D6,D32")
Worksheets("Data").Range("C3").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red
Tags").Range("D4")
End If
If TLLT.Value = True Then
Worksheets("Data").Range("A4").Copy
ActiveSheet.Paste Destination:=Worksheets("Red
Tag").Range("D6,D32")
Worksheets("Data").Range("C4").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red
Tags").Range("D4")

Then it calls a text box that always displays a Default value of 12. It
would be nice to have the "12" replaced by either 12 if TL30 is selected,
9
if TL40 is selected, or 6 if TLLT is selected.

Dim Message, Title, Default, Squares
Dim TagNumber As Integer

Message = "Enter the number of squares for this tag" ' Set
prompt.
Title = "Squares" ' Set title.
Default = "12" ' Set default.
' Display message, title, and default value.
Squares = InputBox(Message, Title, Default)

How can I replace the 12 with the selected product reference number?

Thanks,
Mike


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Insert value in text box based on previous tselected value.

Aaaahh, I will give that a try.

Thanks Dan!


"DanRoss" wrote:

'Im making some assumptions based on what I see but . . . . (example is not
checked for correctness it's just a basic sample) . .. it looks like you
could . . .

Dim Message, Title, Default, Squares
Dim TagNumber As Integer
Message = "Enter the number of squares for this tag" ' Set prompt.
Title = "Squares" ' Set title.

'ADD THIS to SET Default
IF TL30.Value = True Then
Default = "12"
ElseIF TL40.Value = True Then
Default = "9"
ElseIF TLLT.Value = True Then
Default = "6"
Else 'Unknow value so assume 12
Default = "12"
End if

' Display message, title, and default value.
Squares = InputBox(Message, Title, Default)



"Mike K" wrote in message
...
Oh Wise Ones,

The first block on this user forms allows me to select the product based
on
1 of 3 radio button selections.

Sub EnterData_Click()
Worksheets("Open Red Tags").Activate
Worksheets("Open Red Tags").Rows(4).Insert
If TL30.Value = True Then
Worksheets("Data").Range("A2").Copy
ActiveSheet.Paste Destination:=Worksheets("Red
Tag").Range("D6,D32")
Worksheets("Data").Range("C2").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red
Tags").Range("D4")
End If
If TL40.Value = True Then
Worksheets("Data").Range("A3").Copy
ActiveSheet.Paste Destination:=Worksheets("Red
Tag").Range("D6,D32")
Worksheets("Data").Range("C3").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red
Tags").Range("D4")
End If
If TLLT.Value = True Then
Worksheets("Data").Range("A4").Copy
ActiveSheet.Paste Destination:=Worksheets("Red
Tag").Range("D6,D32")
Worksheets("Data").Range("C4").Copy
ActiveSheet.Paste Destination:=Worksheets("Open Red
Tags").Range("D4")

Then it calls a text box that always displays a Default value of 12. It
would be nice to have the "12" replaced by either 12 if TL30 is selected,
9
if TL40 is selected, or 6 if TLLT is selected.

Dim Message, Title, Default, Squares
Dim TagNumber As Integer

Message = "Enter the number of squares for this tag" ' Set
prompt.
Title = "Squares" ' Set title.
Default = "12" ' Set default.
' Display message, title, and default value.
Squares = InputBox(Message, Title, Default)

How can I replace the 12 with the selected product reference number?

Thanks,
Mike


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
Insert text from another workbook based on criteria Tacrier Excel Worksheet Functions 4 April 9th 08 11:01 PM
Insert text based on another cell's colour or font in Excel 2003 Philip Hinton Excel Discussion (Misc queries) 3 December 5th 07 12:48 AM
Insert text based on another cell's colour or font in Excel 2003 Philip Hinton Excel Worksheet Functions 3 December 5th 07 12:48 AM
Insert text in Cell A1 based on keyword criteria [email protected] Charts and Charting in Excel 1 June 13th 06 04:56 PM
Insert text based on date honyacker Excel Discussion (Misc queries) 2 January 30th 06 09:06 PM


All times are GMT +1. The time now is 06:44 PM.

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

About Us

"It's about Microsoft Excel"