if checbox value true then

dilipgr

New Member
Joined
Jan 30, 2015
Messages
43
ennaku oru chinna code than vennum. checkbox true va iruntha combobox2 la date set pannitu textbox la na yenna value kudukurano athu antha column fulla vanthudanum yaracham help pannunga ple.

Station1234567
SunMonTueWedThuFriSat
AKM
APK
ARR
ART
ASD
ATR
BTU
CDM
CGL
CJB
CMM

<colgroup><col><col span="7"></colgroup><tbody>
</tbody>


Option Explicit


Dim rData As Range


Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ComboBox1.Visible = False
Else
If CheckBox1.Value = False Then
ComboBox1.Visible = True
End If
End If
End Sub


Private Sub CommandButton1_Click()
'///ListIndex starts at zero so add 1 to get the row.. To get the column add two because Column A does not contain a date
rData.Cells(Me.ComboBox1.ListIndex + 1, Me.ComboBox2.ListIndex + 2).Value = Me.TextBox1.Value
ThisWorkbook.Save
ComboBox1.Text = ""

End Sub


Private Sub CommandButton2_Click()
End
End Sub


Private Sub UserForm_Initialize()
Dim iX As Integer
'define the range of data
Set rData = Sheet1.Range("A4").CurrentRegion.Offset(1)
With Me
'/// load the stations from column 1 of the data range
.ComboBox1.List = rData.Columns(1).Value
'///load the dates formatted as short date e.g. 01/01/15
For iX = 2 To rData.Columns.Count
.ComboBox2.AddItem Format(Sheet1.Cells(3, iX).Value, "short date")
Next iX
End With
End Sub
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,215,446
Messages
6,124,900
Members
449,194
Latest member
JayEggleton

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