murugan_kotheesan
murugan_kotheesan

Reputation: 43

emailing selected range only visible cells from excell in vba

i have th below code to send an email from excell which has the selected range of the active sheet in the body of mail

  Sub Ticke_status_mail()

   ' Select the range of cells on the active worksheet.
   ActiveSheet.Range("A12:J74").Select

   ActiveWorkbook.EnvelopeVisible = True

   With ActiveSheet.MailEnvelope
      .Item.To = "[email protected]"
      .Item.subject = "Ticket status on " & ActiveSheet.Range("today").Value
      .Item.Send
   End With
End Sub

but is is also sending the hidden rows in the selected rang which should not come in the mail, could some one help in selectimg only visible cells in that range....

Upvotes: 0

Views: 5665

Answers (1)

KV Ramana
KV Ramana

Reputation: 89

try with ActiveSheet.Range("A12:J74").SpecialCells(xlCellTypeVisible).select

Upvotes: 1

Related Questions