Thread: Offset
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Manville Bill Manville is offline
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