Is this a question that has no answer??
Is this the wrong area for this question... Can someone see if this code is appropriate and why it does not function correctly?
Private Sub CommandButton1_Click()
'Sub Send_Range()
Dim SelectRange As String
SelectRange = ""
If UserForm1.CheckBox1.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "C4:C47"
End If
If UserForm1.CheckBox2.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "D4:D47"
End If
If UserForm1.CheckBox3.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "E4:E47"
End If
If UserForm1.CheckBox4.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "F4:F47"
End If
If UserForm1.CheckBox5.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "G4:G47"
End If
If UserForm1.CheckBox6.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "H4:H47"
End If
If UserForm1.CheckBox7.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "I4:I47"
End If
If UserForm1.CheckBox8.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "J4:J47"
End If
If UserForm1.CheckBox9.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "K4:K47"
End If
If UserForm1.CheckBox10.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "L4:L47"
End If
If UserForm1.CheckBox11.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "M4:M47"
End If
If UserForm1.CheckBox12.Value = True Then
SelectRange = SelectRange + "," + "B3:B47"
SelectRange = SelectRange + "," + "N4:N47"
End If
'So AS, checkbox3,4,5.......
UserForm1.CheckBox1.Value = False
UserForm1.CheckBox2.Value = False
UserForm1.CheckBox3.Value = False
UserForm1.CheckBox4.Value = False
UserForm1.CheckBox5.Value = False
UserForm1.CheckBox6.Value = False
UserForm1.CheckBox7.Value = False
UserForm1.CheckBox8.Value = False
UserForm1.CheckBox9.Value = False
UserForm1.CheckBox10.Value = False
UserForm1.CheckBox11.Value = False
UserForm1.CheckBox12.Value = False
'So AS, checkbox3,4,5.......
' Select the range of cells on the active worksheet.
'ActiveSheet.Range("B3:P47").Select
'ActiveSheet.Range("").Select
If SelectRange <> "" Then
SelectRange = Mid(SelectRange, 2, Len(SelectRange))
Sheets("sheet1").Range(SelectRange).Select
End If
' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True
' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "John Fletcher Current Stats"
.Item.To = ""
.Item.CC = "[email protected]"
.Item.Subject = "Fletcher, Current Stats"
.Item.Send
End With
End Sub
Private Sub CommandButton2_Click()
UserForm1.Hide
End Sub
Best Regards,
John
Bookmarks