Add content to empty cells in column - macro

doriannjeshi

Active Member
Joined
Apr 5, 2015
Messages
286
Office Version
  1. 365
Platform
  1. Windows
Hi,

I need to add a 1 in the empty cells in column A to the last cell of the range, in an active sheet

Book1
AB
1junemarch
2
3aprilapril
4aprilapril
5aprilapril
6
7marchmarch
8
9octoberoctober
10
11novembernovember
12
13maymay
14
15januaryjanuary
16
17februaryfebruary
18februaryfebruary
19
20februaryfebruary
21junejune
22
23aprilapril
24
25RESULT:
26junemarch
271
28aprilapril
29aprilapril
30aprilapril
311
32marchmarch
331
34octoberoctober
351
36novembernovember
371
38maymay
391
40januaryjanuary
411
42februaryfebruary
43februaryfebruary
441
45februaryfebruary
46junejune
471
48aprilapril
Sheet1
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Maybe...
VBA Code:
Sub Doriann()
Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row).SpecialCells(4) = 1
End Sub
 
Upvote 0
Solution
Sir, possible to this type of solution with a formula Please.

Not with a formula in the same range but you can do the below

  1. Select the range in Column A
  2. Press Ctrl + G
  3. Click Special
  4. Select Blanks
  5. Click Ok
  6. Press F2
  7. Type 1
  8. Press Ctrl + Enter
 
Last edited:
Upvote 0
Not with a formula in the same range but you can do the below

  1. Select the range in Column A
  2. Press Ctrl + G
  3. Click Special
  4. Select Blanks
  5. Click Ok
  6. Press F2
  7. Type 1
  8. Press Ctrl + Enter
Very very thankful to you for this information.
 
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,043
Members
452,542
Latest member
Bricklin

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