Force cell A1 to have input

deanl33069

Board Regular
Joined
May 2, 2019
Messages
120
Force cell A1 to have input before cell B1----z1 can be filled then same for A2 before b2---z2 can be filled
So each Row must have a input in (A) column before any other columns are filled in that row
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter data in columns B:Z and press the RETURN key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("B:Z")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    If Range("A" & Target.Row) = "" Then
        MsgBox ("Please fill in cell A" & Target.Row & ".")
        Target.ClearContents
        Range("A" & Target.Row).Select
    End If
    Application.EnableEvents = True
End Sub
 
Last edited:
Upvote 0
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Dim targetRow As Long
targetRow = Target.Row
If Cells(targetRow, 1).Value = "" Then
    MsgBox "Please fill in Column A"
    Target.Value = ""
End If
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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