Macro for submitting data

John_Help_Me

New Member
Joined
May 15, 2006
Messages
17
All:

I have a macro button from a command button. The macro just autopopulates data for me into a sheet. How do I validate that data has been entered, meaning how does the macro know?

For example, in the data sheet, the user must enter in Name, Address and Phone number, in cells A1, A2, and A3, respectively. They then click the button and my other sheets gets populated with all three information.

How can I make it so that the user MUST enter all three data points?

Thanks in advance.
John
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
An example:

Code:
Sub Test()
    With Worksheets("Sheet1")
        If WorksheetFunction.CountA(Range("A1:A3")) <> 3 Then
            MsgBox "Data missing"
            Exit Sub
        Else
'           Your code
        End If
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,613
Messages
6,120,515
Members
448,968
Latest member
Ajax40

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