ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   date range (https://www.excelbanter.com/excel-programming/400432-date-range.html)

SangelNet

date range
 
hi guys

is used a code from the following post:

http://groups.google.com/group/micro...7 8d621af00bb

modified it, and i got this

Sub daterange(Optional eta As Date)


today = DateSerial(2007, 1, 1)
For Each cell In Range("H8:H10")
If cell.Value < "" Then
If cell.Value = today Then
sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
End If
End If
Next
If sStr < "" Then
MsgBox sStr
End If
End Sub

not en expert and dont know how to establish and make today = "todays
date"

how do i establish that ?


Gary''s Student

date range
 
In place of:
today = DateSerial(2007, 1, 1)
use:
today=Date
--
Gary''s Student - gsnu200753


"SangelNet" wrote:

hi guys

is used a code from the following post:

http://groups.google.com/group/micro...7 8d621af00bb

modified it, and i got this

Sub daterange(Optional eta As Date)


today = DateSerial(2007, 1, 1)
For Each cell In Range("H8:H10")
If cell.Value < "" Then
If cell.Value = today Then
sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
End If
End If
Next
If sStr < "" Then
MsgBox sStr
End If
End Sub

not en expert and dont know how to establish and make today = "todays
date"

how do i establish that ?



SangelNet

date range
 
On Nov 1, 2:02 pm, Gary''s Student
wrote:
In place of:
today = DateSerial(2007, 1, 1)
use:
today=Date
--
Gary''s Student - gsnu200753

"SangelNet" wrote:
hi guys


is used a code from the following post:


http://groups.google.com/group/micro...rogramming/bro...


modified it, and i got this


Sub daterange(Optional eta As Date)


today = DateSerial(2007, 1, 1)
For Each cell In Range("H8:H10")
If cell.Value < "" Then
If cell.Value = today Then
sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
End If
End If
Next
If sStr < "" Then
MsgBox sStr
End If
End Sub


not en expert and dont know how to establish and make today = "todays
date"


how do i establish that ?


I always say, the simplest things get you.

Thnx Gary


SangelNet

date range
 
On Nov 1, 2:13 pm, SangelNet wrote:
On Nov 1, 2:02 pm, Gary''s Student



wrote:
In place of:
today = DateSerial(2007, 1, 1)
use:
today=Date
--
Gary''s Student - gsnu200753


"SangelNet" wrote:
hi guys


is used a code from the following post:


http://groups.google.com/group/micro...rogramming/bro...


modified it, and i got this


Sub daterange(Optional eta As Date)


today = DateSerial(2007, 1, 1)
For Each cell In Range("H8:H10")
If cell.Value < "" Then
If cell.Value = today Then
sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
End If
End If
Next
If sStr < "" Then
MsgBox sStr
End If
End Sub


not en expert and dont know how to establish and make today = "todays
date"


how do i establish that ?


I always say, the simplest things get you.

Thnx Gary


Is there a way to make this work with a calender object, so that when
you click a date the macro searches based on the clicked date?



All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com