View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Steve Smallman Steve Smallman is offline
external usenet poster
 
Posts: 47
Default finding and replacing a cell

Rod,

I assume you have a unique combination of Initials and Date.

Simply set up a macro to loop through the initials column, and if it finds
the right initials check the 3rd column right to see if that's the date.

Assumptions:
On sheet info
Row 1 contains headings
Column A contains initials
Column C contains dates

this code is untested, and therefore may need modification
Sub update_info(Initials, date)
' best practice says you should declare the variable type for the passed
parameters
Sheets("Info").activate
range("a2"). select
Do until activecell="" 'initialise
loop and limit looping until blank cell reached
If activecell.value=initials then 'check current
cell to see if it mathces initials
If activecell.offset(0,2).value=date then 'if so, check two
columns right to see if it matches date
...... do what you need to ...... 'execute your
code
exit do '
suspend loop
end if
end if
activecell.offset(1,0).select 'move one cell
down
loop '
because exit do wasn't executed, loop to the top and start again
End sub

Steve


"Rod Taylor" wrote in message
...
I need some help. I am working on a schedule.I have 14 different sheets

and
each sheet is named in two digit format according to the date. I also have

a
hidden sheet named INFO

On the Info sheet I have a column with different initials, and the third

row
contains the date also in two digit format.
I can get the initials from the Marco being worked on at the time and I
think I can get the date from the sheet name being worked on
So here is the question. How do I change the cell that corresponds to the
row containing the initials and the column with the date on sheet info.

the
date will change and from time to time so will the initials so the area

does
not have named ranges but I could do this if that is required I just

thought
that might be in the wrong direction.
Any help would be appreciated
Thanks Rod