Writing to empty cells in a range?

London_Calling

Active Member
Joined
Feb 27, 2007
Messages
256
I have many sheets of data that contain occasional and random blank cells. Before transferring the sheets to Access, I want to put 'no data' in each black cell. I've read how to do that here before but just can't find that snippet....

Edit: I should add, I have this much:

Code:
       Range("B2").Select
        myrange = ActiveCell.CurrentRegion

Could someone please remind me? Thanks very much.
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Selection.SpecialCells(xlCellTypeBlanks).Value = "no data"
or:
myrange.SpecialCells(xlCellTypeBlanks).Value = "no data"
or just:
Range("B2").CurrentRegion.SpecialCells(xlCellTypeBlanks).Value = "no data"
 
Upvote 0
Good idea to include a structure like this so you code doesn't error if there are no 'specialcells' in the relevant range
Code:
On Error Resume Next
'your SpecialCells line of code here
On Error GoTo 0
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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