Hello Excel gurus,
I have created a form using form controls from the Developer tab in excel. The form contains cells, checkbox and radiobutton. I have provided a Submit button which has a macro assigned to it.
When the user clicks on submit, i want to save the user values into another workbook. I have written the below macro and the user input from different cells is sucessfully saved. But, i am not aware of how to read the radiobutton and checkbox value and save it in the workbook.
Sub Submit()
Dim wb As Workbook, NR As Long
Set wb = Workbooks.Open("Final.xls")
NR = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1
With ThisWorkbook.Sheets("Sheet1")
wb.Sheets("Sheet1").Range("A" & NR).Value = .Range("A3:D3").Value
wb.Sheets("Sheet1").Range("B" & NR).Value = .Range("A4:D4").Value
wb.Sheets("Sheet1").Range("C" & NR).Value = .Range("A5:D5").Value
wb.Sheets("Sheet1").Range("D" & NR).Value = .Range("F3:G3").Value
wb.Sheets("Sheet1").Range("E" & NR).Value = .Range("F4:G4").Value
wb.Sheets("Sheet1").Range("F" & NR).Value = .Range("F5:G5").Value
wb.Sheets("Sheet1").Range("G" & NR).Value = .Range("H3").Value
wb.Sheets("Sheet1").Range("H" & NR).Value = .Range("A8:H8").Value
End With
wb.Close SaveChanges:=True
End Sub
Please help me in getting the user values for radiobutton and checkbox.
Thanks,
Kaddy.
I have created a form using form controls from the Developer tab in excel. The form contains cells, checkbox and radiobutton. I have provided a Submit button which has a macro assigned to it.
When the user clicks on submit, i want to save the user values into another workbook. I have written the below macro and the user input from different cells is sucessfully saved. But, i am not aware of how to read the radiobutton and checkbox value and save it in the workbook.
Sub Submit()
Dim wb As Workbook, NR As Long
Set wb = Workbooks.Open("Final.xls")
NR = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1
With ThisWorkbook.Sheets("Sheet1")
wb.Sheets("Sheet1").Range("A" & NR).Value = .Range("A3:D3").Value
wb.Sheets("Sheet1").Range("B" & NR).Value = .Range("A4:D4").Value
wb.Sheets("Sheet1").Range("C" & NR).Value = .Range("A5:D5").Value
wb.Sheets("Sheet1").Range("D" & NR).Value = .Range("F3:G3").Value
wb.Sheets("Sheet1").Range("E" & NR).Value = .Range("F4:G4").Value
wb.Sheets("Sheet1").Range("F" & NR).Value = .Range("F5:G5").Value
wb.Sheets("Sheet1").Range("G" & NR).Value = .Range("H3").Value
wb.Sheets("Sheet1").Range("H" & NR).Value = .Range("A8:H8").Value
End With
wb.Close SaveChanges:=True
End Sub
Please help me in getting the user values for radiobutton and checkbox.
Thanks,
Kaddy.