I'm the newest girl using VBA for Excel, so I've been doing a lot of research but since this isn't my knowledge field I'm pretty sure I'm missing something.
I used an UserForm for selecting 5 different columns of data, if you choose option 1, you get data from "x" column, if you choose option 2, you get data from "y" column and so on. This data has to be copied and pasted from one worksheet to another, but I can't make it work.
Can you tell me what am I doing wrong?
Oh yeah! As a background, this isn't mine. The workbook was sent to me, and I have to edit it according to the needs of my workplace.
This is my code.
Private Sub UserForm_Click()
If UserForm6.OptionButton1.Value = True Then
Sheets("Operations").Select
Range("B7:M33").Select
Selection.ClearContents
Sheets("Processes").Select
Range("D2:D33").Select
Selection.Copy
Sheets("Operations").Select
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ElseIf UserForm6.OptionButton2.Value = True Then
Sheets("Operations").Select
Range("B7:M33").Select
Selection.ClearContents
Sheets("Processes").Select
Range("I2:I33").Select
Selection.Copy
Sheets("Operations").Select
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ElseIf UserForm6.OptionButton3.Value = True Then
Sheets("Operations").Select
Range("B7:M33").Select
Selection.ClearContents
Sheets("Processes").Select
Range("N2:N33").Select
Selection.Copy
Sheets("Operations").Select
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ElseIf UserForm6.OptionButton4.Value = True Then
Sheets("Operations").Select
Range("B7:M33").Select
Selection.ClearContents
Sheets("Processes").Select
Range("S2:S33").Select
Selection.Copy
Sheets("Operations").Select
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ElseIf UserForm6.OptionButton5.Value = True Then
Sheets("Operations").Select
Range("B7:M33").Select
Selection.ClearContents
Sheets("Processes").Select
Range("X2:X33").Select
Selection.Copy
Sheets("Operations").Select
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
End Sub
I'd love any help you can give! And by the way, English isn't my native language so I hope you can understand most of what I'm asking.
Thank you!