Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following method will check for valid rows. In my example, the data
is organized as this: [date] [value] <-- column A holds the dates, column B holds the data Example: 2006-10-11 (column A) values (column B) The method will NOT email the results. Just hit Google with "Excel vba send mail" and you will have plenty of examples. Your problem with finding the correct cells can be solved in numerous ways, here it one I've succesfully tested. Sub FetchTodaysRows() Dim ws As Worksheet Dim rngData As Range Dim c As Range Dim strOut As String 'worksheet containing data Set ws = Worksheets("mydata") 'the range where the data is Set rngData = ws.Range("A1:A10") For Each c In rngData If c.Value = Date Then strOut = strOut & c.Value & " " & c.Offset(0, 1).Value & Chr(10) End If Next c Debug.Print strOut End Sub Please note: ..Offset(0,1).Value <-- gives the value of column b Chr(10) <-- add a line feed -Fredrik |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to send email | Excel Discussion (Misc queries) | |||
A macro that will hide all but the last 20 dated rows. | Excel Discussion (Misc queries) | |||
macro to send email | Excel Discussion (Misc queries) | |||
Buttons/1-add rows /2-auto save & name, close, send in email | Excel Programming | |||
how do i send email from a macro | Excel Programming |