View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
STEVE BELL STEVE BELL is offline
external usenet poster
 
Posts: 692
Default Search and Copy within Excel using VBA

Try something like

For i = 1 to 500
if Month(Cell(i,2)) = Month(Date) then

' code
ElseIf Month(Cell(i,2)) = Month(Date) + 1
'code
End If
next
--
steveB

Remove "AYN" from email to respond
"sapper44" wrote in message
...
I am using Excel as a Contact Database. The various columns include Name,
Address, Phone, etc. The column of interest for this post is the
"Birthday"
Column

I would like to set up a pushbutton that searches through the "Birthday"
column, finds birthdays that are within the current month, and then places
those names and birthdays in 2 side-by-side columns. I would also like to
create one for the "next" month.

I have been using the "Month" and "Find" commands combined with a For
loop.
I am having trouble figuring out how to place the Name and Birthday into a
cell, and then place the next Name and next Birthday into another cell.

I am familiar with programming, just not Visual Basic. I could use some
help. This seems like an easy thing to do.

Thanks in advance!!