Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default How do I write a "For Each Statement" nested in a "With Statement"?

Hi
how is 'dtReportDate' defined?

--
Regards
Frank Kabel
Frankfurt, Germany

"Mcasteel" schrieb im
Newsbeitrag ...

-My For Each Statement wont work:

Im trying to print a customer record in a report for each occurance

of
a date that is seached for. If the end user is looking for the date
10/23/2004, they input it into an input box, its converted from a
string to a date (dtReportDate) and if the date is found, each record
containing that date will create a new record in my report.

Does anyone have any ideas on how how to fix this, am I placing it in
the right location of my code?

Thank you for your help.-



With Worksheets(1)
Set rng = .Columns(68).Find(dtReportDate)
Debug.Print "Displaying Quarried Results to Report"

If Not rng Is Nothing Then
*For Each dtReportDate In rng*

'Comments on Next Action (Cust.Contact.Log)
'Enrolled Date
rngactive.Offset(4, 0).Value = .Cells(rng.Row,
68).Value
'Next Action comments
rngactive.Offset(4, 1).Value = .Cells(rng.Row,
69).Value
'SSN
rngactive.Offset(4, 2).Value = .Cells(rng.Row,
6).Value
'Acct
rngactive.Offset(4, 3).Value = .Cells(rng.Row,
14).Value
'L Name
rngactive.Offset(4, 4).Value = .Cells(rng.Row,
3).Value
'F Name
rngactive.Offset(4, 5).Value = .Cells(rng.Row,
4).Value
'Enrolled
rngactive.Offset(4, 6).Value = .Cells(rng.Row,
1).Value
*Next dtReportDate*


Else:
Debug.Print "No Matching Date (Next Action Step)"
MsgBox "No Action Needed for Date Searched (Next Action
Step)."
End If
End With


--
Mcasteel
---------------------------------------------------------------------

---
Mcasteel's Profile:

http://www.excelforum.com/member.php...o&userid=15698
View this thread:

http://www.excelforum.com/showthread...hreadid=276390


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
=If( statement for 80-90% condition then write "ME" Master T Excel Worksheet Functions 6 July 18th 08 10:31 AM
How do I write a conditional "IF" statement to color a group of ce mulehead Excel Discussion (Misc queries) 2 November 8th 07 08:16 PM
Nested If Statement "FALSE" Return Margie Excel Worksheet Functions 8 August 17th 07 11:37 PM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM


All times are GMT +1. The time now is 02:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"