Hi Everyone,
I have 2 databases on 1 worksheet.
One is 5 columns wide with 1 column being dates that exclude weekends, holidays, etc. and only has about 20 years of data.
The other is 12 columns wide and includes all dates from 1/1/1900 to 1/1/2020. It includes weekends, holidays
Is there an easy VBA code to write that will eliminate all the rows in the larger file whose dates don't include the dates in the smaller?
I have many files that I am trying to do this, and thought a VBA macro would be easiest.
I am trying a do loop
dim rowf as long
rowf = 2
do
if(cells(rowf,"N")<>cells(rowf,"B") then
*****How do I write a code in vba to delete just the cells in row rowf in just columns "A" through "L"?
end if
rowf=rowf+1
loop until cells(rowf,"N")=""
end sub
Any ideas? Is this the easiest or is there an easier way?
Thanks!!
Ken
I have 2 databases on 1 worksheet.
One is 5 columns wide with 1 column being dates that exclude weekends, holidays, etc. and only has about 20 years of data.
The other is 12 columns wide and includes all dates from 1/1/1900 to 1/1/2020. It includes weekends, holidays
Is there an easy VBA code to write that will eliminate all the rows in the larger file whose dates don't include the dates in the smaller?
I have many files that I am trying to do this, and thought a VBA macro would be easiest.
I am trying a do loop
dim rowf as long
rowf = 2
do
if(cells(rowf,"N")<>cells(rowf,"B") then
*****How do I write a code in vba to delete just the cells in row rowf in just columns "A" through "L"?
end if
rowf=rowf+1
loop until cells(rowf,"N")=""
end sub
Any ideas? Is this the easiest or is there an easier way?
Thanks!!
Ken