Prakt81302
New Member
- Joined
- Apr 27, 2016
- Messages
- 1
Hello,
This might be a bit complicated:
I am preparing a checklist with many sheets and hundreds of "yes/no" questions. The questions are to be answered by choosing between option buttons (there are two per question). I am trying to program each "no" option button (any alternatives?) so that whenever it is clicked, the button should redirect the user to a second workbook "evaluation.xlsx" AND copy the said question into the range("D11:D27") on "Sheet2" of the "evaluation.xlsx". The tricky part for me is that the questions are independent from each other and if answered "no", they must be copied into a certain range one below the other, making a list starting from the cell D11.
The code I have been working on is
I don't know how to make the list start at D11 and end at D27 without pasting anything outside the range. Could someone correct it?
Thanks in advance
This might be a bit complicated:
I am preparing a checklist with many sheets and hundreds of "yes/no" questions. The questions are to be answered by choosing between option buttons (there are two per question). I am trying to program each "no" option button (any alternatives?) so that whenever it is clicked, the button should redirect the user to a second workbook "evaluation.xlsx" AND copy the said question into the range("D11:D27") on "Sheet2" of the "evaluation.xlsx". The tricky part for me is that the questions are independent from each other and if answered "no", they must be copied into a certain range one below the other, making a list starting from the cell D11.
The code I have been working on is
Code:
Private Sub OptionButton3_Click()
Dim lst As Long
ActiveWorkbook.Sheets("Sheet1").Range("C18").Copy
Dim wb1 As Excel.Workbook
Set wb1 = Workbooks.Open("C:\Users\blabla\Documents\glc\evaluation.xlsx")
With Sheets("Sheet2")
lst = .Range("D" & Rows.Count).End(xlUp).Row + 1
.Range("D" & lst).PasteSpecial xlPasteColumnWidths
.Range("D" & lst).PasteSpecial xlPasteValues
End With
ActiveWorkbook.FollowHyperlink Address:="C:\Users\blabla\Documents\glc\evaluation.xlsx", NewWindow:=True
End Sub
I don't know how to make the list start at D11 and end at D27 without pasting anything outside the range. Could someone correct it?
Thanks in advance