Macro problem

one_more_cave_dweller

Board Regular
Joined
Sep 27, 2004
Messages
118
I have a macro that copies information from a sheet each day and pastes it horizontally into a summary sheet for the month. (a1=1st, a2=2nd etc.).
The macro is triggered by a control button in the first sheet the user clicks after they have entered the information. How can I stop them from entering the same day twice? I have tried cell validation but that only stops the first column from being repeated. I need the macro to stop if the first column (a) is a repeat.

Thanks
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try the following

Use the following code in the beginning of your. It will insert today's date in cell (X1) when user clicks on your button first time. Change (X1) according to your settings.

Code:
If IsEmpty(Cells(1, 24)) Or Cells(1, 24) <> Int(Now()) Then
    Cells(1, 24) = Int(Now())
' Your code here
else
msgbox "Already copied"
End if


Regards

Mac
 
Upvote 0

Forum statistics

Threads
1,203,491
Messages
6,055,727
Members
444,814
Latest member
AutomateDifficulty

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