ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search and Copy within Excel using VBA (https://www.excelbanter.com/excel-programming/335325-search-copy-within-excel-using-vba.html)

sapper44

Search and Copy within Excel using VBA
 
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!!

Don Guillett[_4_]

Search and Copy within Excel using VBA
 
why not just use
datafilterautofiltercustom

--
Don Guillett
SalesAid Software

"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!!




STEVE BELL

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!!





All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com