Hello all
Hope you can help! I have spent weeks trying to learn VBA on my own and think I have almost read every page on the net, my head aches. I am stuck! I have the form created and think I have loaded it properly, now I need some check boxes to work, can you tell me if I am coding it right for what I want to do. I am trying to activate checkboxes.Say I have 5 check boxes, if the user ticks check box 1, I want it to go on my worksheet in column G2, if checkbox 2 is ticked then H2 and so on. Now if I have followed instructions correctly on the net the first part of my code should be right, they are text boxes, its when it gets to checkbox 1 ..........
Private Sub Savebtn_Click()
ActiveWorkbook.Sheets("Sheet1").Activate
Range("A2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = DateCall.Value
ActiveCell.Offset(0, 1) = CallerName.Value
ActivateCell.Offset(0, 2) = StreetName.Value
ActivateCell.Offset(0, 3) = City.Value
ActivateCell.Offset(0, 4) = PostalCode.Value
ActivateCell.Offset(0, 5) = PhoneNumber.Value
If checkbox1 = True Then
ActivateCell.Offset(0, 6).Value = "Yes"
Else
ActivateCell.Offset(0, 6).Value = ""
ElseIf
Checkbox2 = True Then
ActivateCell.Offset (0,7).Value= "Yes"
Else
ActivateCell.Offset (0,7).Value - ""
Else
Checkbox3 = True Then
ActivateCell.Offset (0,8).Value = "Yes"
and so on
End If
The problem I have when I choose RunSub Userform from design and I have to use Task Manager to close it all down I will sort later! My life is dependent on this form :-(
Hope you can help! I have spent weeks trying to learn VBA on my own and think I have almost read every page on the net, my head aches. I am stuck! I have the form created and think I have loaded it properly, now I need some check boxes to work, can you tell me if I am coding it right for what I want to do. I am trying to activate checkboxes.Say I have 5 check boxes, if the user ticks check box 1, I want it to go on my worksheet in column G2, if checkbox 2 is ticked then H2 and so on. Now if I have followed instructions correctly on the net the first part of my code should be right, they are text boxes, its when it gets to checkbox 1 ..........
Private Sub Savebtn_Click()
ActiveWorkbook.Sheets("Sheet1").Activate
Range("A2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = DateCall.Value
ActiveCell.Offset(0, 1) = CallerName.Value
ActivateCell.Offset(0, 2) = StreetName.Value
ActivateCell.Offset(0, 3) = City.Value
ActivateCell.Offset(0, 4) = PostalCode.Value
ActivateCell.Offset(0, 5) = PhoneNumber.Value
If checkbox1 = True Then
ActivateCell.Offset(0, 6).Value = "Yes"
Else
ActivateCell.Offset(0, 6).Value = ""
ElseIf
Checkbox2 = True Then
ActivateCell.Offset (0,7).Value= "Yes"
Else
ActivateCell.Offset (0,7).Value - ""
Else
Checkbox3 = True Then
ActivateCell.Offset (0,8).Value = "Yes"
and so on
End If
The problem I have when I choose RunSub Userform from design and I have to use Task Manager to close it all down I will sort later! My life is dependent on this form :-(