Good Afternoon!
So I have no VBA background, but I have managed to put this together for a workbook where the ultimate goal is to have users (Engineers) select certain checkboxes. When they are done (And there will be a lot of checkboxes), they click the button "Build" and depending on their selections, they will generate a new worksheet or new workbook (Haven't decided on that one yet) with all the selected information pasted into it, in order.
I'm currently testing out the "Copying from defined range" part of this.
Now when you click a checkbox, the cell it is linked to will say TRUE. So originally, i set the If statement to TRUE, but i just got a failure message. Then i tried "TRUE". Error again. So I made it point to another cell with the formula
Now it works.
At least for Case 1.
Case 2 keeps giving me the "Case 2 - Failed." message.
I'm not sure why either of these are happening.
On another note, if Case 1 = False and Case 2 = True, would case 2 start at cell A1?
Here is a link to the file via my Google Drive
https://drive.google.com/file/d/0Bza853yM-QSMOXhsR0E2QXpWTnc/edit?usp=sharing
Thanks for your wisdom,
-Dan
So I have no VBA background, but I have managed to put this together for a workbook where the ultimate goal is to have users (Engineers) select certain checkboxes. When they are done (And there will be a lot of checkboxes), they click the button "Build" and depending on their selections, they will generate a new worksheet or new workbook (Haven't decided on that one yet) with all the selected information pasted into it, in order.
I'm currently testing out the "Copying from defined range" part of this.
Code:
Sub Merge()
Select Case Range("H3").Value
Case 1
If Range("H3") = 1 Then
Sheets("Data").Select
Range("A1:A8").Select
Selection.Copy
Sheets("UI").Select
Cells(1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End If
Case Else
MsgBox "Case 1 - Failed."
End Select
Select Case Range("H6").Value
Case 2
If Range("H6") = 1 Then
Sheets("Data").Select
Range("A10:A17").Select
Selection.Copy
Sheets("UI").Select
Cells(1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End If
Case Else
MsgBox "Case 2 - Failed."
End Select
End Sub
Now when you click a checkbox, the cell it is linked to will say TRUE. So originally, i set the If statement to TRUE, but i just got a failure message. Then i tried "TRUE". Error again. So I made it point to another cell with the formula
Code:
=IF(F3=TRUE,1,"")
Now it works.
At least for Case 1.
Case 2 keeps giving me the "Case 2 - Failed." message.
I'm not sure why either of these are happening.
On another note, if Case 1 = False and Case 2 = True, would case 2 start at cell A1?
Here is a link to the file via my Google Drive
https://drive.google.com/file/d/0Bza853yM-QSMOXhsR0E2QXpWTnc/edit?usp=sharing
Thanks for your wisdom,
-Dan