Change cell string if cell IsEmpty

I3atnumb3rs

New Member
Joined
Nov 2, 2018
Messages
34
Hello,

I'm trying to make it so that if colum B cell is empty to change column P cell to cancelled, but I can't seem to make it work. please help!

Sub ChngProgUnassigned()




Dim Col As Variant
Dim BlankRows As Long
Dim LastRow As Long
Dim r As Long
Dim StartRow As Long


Col = "B"
StartRow = 1
BlankRows = 1


LastRow = Cells(Rows.Count, Col).End(xlUp).Row




With ActiveSheet
For r = LastRow To StartRow + 1 Step -1
If IsEmpty(Cells(r, Col)) = True Then
.Cells(r, Col + 14).Value = "CANCELLED"
End If
Next r
End With


End Sub
 

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
Glad we could help & thanks for the feedback.


Rick
Missed your edit, what can I say :laugh:
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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