#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Offset

Hello Gurus and newsgroup users.

Your kind assistance please.


I'm relatively new to Excel VBA so please bear with me if
the question is a little vague.

I have the formula below in Cells I3: I53 (each row
signifies a specific record)

=IF(A3="a","Done",IF(H3=TODAY(),"Today",IF(H3=" ","",IF
(A3="s","On Hold",IF(H3<TODAY(),"Late",NETWORKDAYS(TODAY
(),H3))))))

Also the same range has conditional formatting associate.

For a couple of reasons I want to convert this formula
into VBA.

I think I need to use a Select Case statement to encompass
all.

My question is:-

Do I use Offset to make the changes in the adjoining cells.

Many thanks for any advise you can give me.

DaveS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Offset

Dave S wrote:
For a couple of reasons I want to convert this formula
into VBA.

I think I need to use a Select Case statement to encompass
all.

My question is:-

Do I use Offset to make the changes in the adjoining cells.


If you mean you want to use a VBA Function in the formula in the cells
then the function can only change the cell from which it was called, by
returning a result to that cell.

If you want a macro to run down the 51 cells changing their value, then
that's fine. Something like this

Sub UpdateColumnI()
Dim I As Integer
Dim V
For I=3 To 53
If Cells(I, "A")="a" Then
V="Done"
ElseIf Cells(I, "H")=Date Then
V="Today"
ElseIf....
End If
Cells(I, "I")=V
Next
End Sub


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Offset

Thanks for your time Bill. I appreciate your response.


-----Original Message-----
Dave S wrote:
For a couple of reasons I want to convert this formula
into VBA.

I think I need to use a Select Case statement to

encompass
all.

My question is:-

Do I use Offset to make the changes in the adjoining

cells.


If you mean you want to use a VBA Function in the formula

in the cells
then the function can only change the cell from which it

was called, by
returning a result to that cell.

If you want a macro to run down the 51 cells changing

their value, then
that's fine. Something like this

Sub UpdateColumnI()
Dim I As Integer
Dim V
For I=3 To 53
If Cells(I, "A")="a" Then
V="Done"
ElseIf Cells(I, "H")=Date Then
V="Today"
ElseIf....
End If
Cells(I, "I")=V
Next
End Sub


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

.

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
OFFSET Jose Mourinho Excel Worksheet Functions 1 December 23rd 09 01:26 PM
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul RyGuy Excel Worksheet Functions 2 September 28th 07 10:54 PM
SUM() and OFFSET() CAUSES #VALUE [email protected] Excel Worksheet Functions 7 September 13th 06 02:46 AM
Max Offset Voodoodan Excel Discussion (Misc queries) 19 May 26th 05 11:47 AM
offset Larry Excel Worksheet Functions 4 May 12th 05 04:10 AM


All times are GMT +1. The time now is 09:42 AM.

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

About Us

"It's about Microsoft Excel"