I have a macro that emails a selection however it also emails the hidden cells in that selection. I gather I am going to need to use [FONT="]SpecialCells(xlCellTypeVisible) however I have no clue where I am going to have to place it. Any help/guidance you can offer would be greatly appreciated!!! [/FONT]
Sub Send_Range()
On Error Resume Next
ActiveSheet.Range("F12").Select
With Worksheets("Pledge Notifications").AutoFilter.Range
ActiveCell.Value2 = Range("A" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Value2
End With
Dim sht As Worksheet
Dim LastRow As Long
Dim LastColumn As Long
Dim StartCell As Range
Set sht = Worksheets("pledge notifications")
Set StartCell = Range("F8")
Worksheets("pledge notifications").UsedRange
LastRow = sht.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
sht.Range("F8:N" & LastRow).Select
Selection.Copy
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.to = Range("C15")
.Item.cc = "mycc"
.Item.Subject = "mysubj"
.Item.Display
End With
End Sub
Code:
On Error Resume Next
ActiveSheet.Range("F12").Select
With Worksheets("Pledge Notifications").AutoFilter.Range
ActiveCell.Value2 = Range("A" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Value2
End With
Dim sht As Worksheet
Dim LastRow As Long
Dim LastColumn As Long
Dim StartCell As Range
Set sht = Worksheets("pledge notifications")
Set StartCell = Range("F8")
Worksheets("pledge notifications").UsedRange
LastRow = sht.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
sht.Range("F8:N" & LastRow).Select
Selection.Copy
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.to = Range("C15")
.Item.cc = "mycc"
.Item.Subject = "mysubj"
.Item.Display
End With
End Sub
Code: