Change cell value along row

alexg7828

New Member
Joined
Aug 4, 2017
Messages
22
Hi,

I am looking for a VBA that when i press ctrl+shift+N certain cell values on that row change if they are empty.

For example..

- I have "B4" selected
- I press ctrl+shift+N
- If "D4" is empty then make value "N/A" else skip
- If "G4" is empty then make value "No" else skip

I guess i need to set the row of the current selected cell as a variable then it is just an "IF" for each of the queries i want.

Help appreciated.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
If this works, you can try adding a shortcut to it of CTRL+SHIFT+N:
VBA Code:
Sub alexg7828()
    
    With Cells(4, 2).Resize(Application.Max(1, Cells(Rows.Count, 2).End(xlUp).Row - 3))
        .Offset(, 2).SpecialCells(xlCellTypeBlanks).Value = "N/A"
        .Offset(, 5).SpecialCells(xlCellTypeBlanks).Value = "No"
    End With
   
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,971
Members
449,059
Latest member
oculus

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