Need VB code

Joined
Feb 15, 2018
Messages
18
Hi. I have zero knowledge of excel VBA.

I am working on a project. From a seperate program i am able to export reports into an excel spreadsheet.
I want to copy and paste the spreadsheet into another excel workbook that has a Macro waiting to be used.
The report results are always the same number of columns, but the number of rows will always be dynamic.

I want a Macro run through a button to do the following.

Compare the results (which is a date) in column B (starting in row 5) to (the date) that is in C2.
I would like the results to be in column F.

The basic formula i have been using is:
=IF ($C $2>B5, "Over", "In")

Any help would be greatly appreciated.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Spaceballs, first off welcome to the site.

As for VBA and a button I too struggled with something similar trying to run VBA on imported data from a 2nd workbook one that would not change, 'pushing my VBA on to a new data WB from an old WB and ended up just saving my Macro into personal.xls and creating a button on the toolbar.

also looking at your formula you have cell $C$2 locked and B5 is not are you only comparing 2 cells or do you want B5, B6, B7...all to compare to C2 with results in F5, F6, F7...
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top