fill down vba

Excelmasters

Board Regular
Joined
Jun 11, 2015
Messages
115
Hi guys,

Am New to the forum and seeking any one's help.

below is my excel looks like, i have just added random data since my original data is sensitive. i need a macro for column C which will do autofill the range.

where you can see the c3 "excel" should get updated till c8 and "mouse" from C9 should updated down till next word.

i have more than 2000 rows like this.. i have tried macro recording. but no use because the data can change everyday.

thanks for your help



Excel 2010
ABC
1User 1User 2user 3
2a1excel
3b2
4c3
5a4
6b5
7c6
8a7
9b8
10c9Mouse
11a10
12b11
13c12
14a13
15b14
16c15
17a16
18b17
19c18
20a19
21b20
22c21
23a22
24b23
25c24Keyboard
26a25
27b26
28c27
29a28
30b29
31c30
32a31
33b32
34c33time
35a34
36b35
37c36
38a37
39b38
40c39
41a40
Sheet2
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Give this non-looping macro a try...
Code:
Sub FillBlanksInColumnC()
  Dim LastRow As Long
  LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  On Error Resume Next
  With Range("C3:C" & LastRow)
    .SpecialCells(xlBlanks).FormulaR1C1 = "=R[-1]C"
    .Value = .Value
  End With
  On Error GoTo 0
End Sub
 
Last edited:
Upvote 0
Maybe this
Code:
Sub MM1()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For r = 1 To lr
If Range("C" & r + 1).Value = "" Then Range("C" & r + 1).Value = Range("C" & r).Value
Next r
End Sub
 
Upvote 0

Forum statistics

Threads
1,196,358
Messages
6,014,780
Members
441,847
Latest member
hw407

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