Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Logic problem

Sub TEST()

Const limitDOWN As Date = #1/1/2007#
Const limitUP As Date = #2/2/2007#
Const isADP As String = "Y"
Dim c As Range
Dim d As Range

For Each c In Worksheets("Instructions").Range("B7:B200").Cells
If c.Value limitDOWN And c.Value < limitUP And _
c.Offset(0,4).Value = isADP Then
With c.Offset(0,4).Font
.Bold = True
.Italic = True
End With
End If
Next c

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Janos" wrote in message
...
Hello,

Sorry again for the silly questions.... I'm a total VBA newbie. How do I
link one operation with the other? looking at the code below, I'm trying

to
make sure that when condition 1 is satisfied (the one with the dates,

using
c) Condition 2 (the one that checks wether it is ADP, using d) is

executed...
but it should only be executed at the point of c. aka only if the date is
right... do I assign the value of c to d before the for statement begins,

or
do i do a counter?

Thank you for your help

Sub TEST()

Const limitDOWN As Date = #1/1/2007#
Const limitUP As Date = #2/2/2007#
Const isADP As String = "Y"
Dim c As Range
Dim d As Range

For Each c In Worksheets("Instructions").Range("B7:B200").Cells
If c.Value limitDOWN And c.Value < limitUP Then
For Each d In Worksheets("Instructions").Range("F7:F200").Cells
If d.Value = isADP Then
With d.Font
.Bold = True
.Italic = True
End With
End If
Next
End If
Next c



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
problem with excel logic, too complicated of a function set??? mvollmers Excel Worksheet Functions 3 October 9th 08 04:07 AM
Finding the average using conditions in a logic function - problem Thomas Excel Discussion (Misc queries) 1 August 1st 08 04:18 PM
logic problem: help needed dcleave Excel Programming 5 August 10th 05 03:31 PM
Logic Problem JOn Kunces via OfficeKB.com Excel Discussion (Misc queries) 4 July 14th 05 04:32 PM
InputBox Method Logic Problem ExcelMonkey[_20_] Excel Programming 2 January 24th 04 04:47 AM


All times are GMT +1. The time now is 08:22 AM.

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"