if checkbox1.value = true then
i select combobox2 value (for example 01/02/2015) then give the value in textbox value= 100 then click the commandbutton i need the output value for the entire column from B2 to B5 = 100. can anyone give the solution.
[TABLE="class: cms_table, width: 324"]
<tbody></tbody>[/TABLE]
[TABLE="width: 50"]
<tbody>[TR]
[TD][/TD]
[TD]01/02/2015[/TD]
[TD]02/02/2015[/TD]
[TD]03/02/2015[/TD]
[TD]04/02/2015[/TD]
[/TR]
[TR]
[TD]ASD[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]VPM[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MAA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CJB[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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
i select combobox2 value (for example 01/02/2015) then give the value in textbox value= 100 then click the commandbutton i need the output value for the entire column from B2 to B5 = 100. can anyone give the solution.
[TABLE="class: cms_table, width: 324"]
<tbody></tbody>[/TABLE]
[TABLE="width: 50"]
<tbody>[TR]
[TD][/TD]
[TD]01/02/2015[/TD]
[TD]02/02/2015[/TD]
[TD]03/02/2015[/TD]
[TD]04/02/2015[/TD]
[/TR]
[TR]
[TD]ASD[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]VPM[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MAA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CJB[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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