VBA Fill the Blank

ziad alsayed

Well-known Member
Joined
Jul 17, 2010
Messages
665
dear all

with the below data , i need to fill the last column, for example from the word VAT and all the above blank cells should be filled with the same word,from the word "NO VAT" and all the above blank cells and so on

appreciate any help
Excel Workbook
ABCDEF
1CodeAcc#Inv. NumDescriptionNet AmountCode
29999-1002-14111110822105357Transportation300
39999-1006-14111110198105359Commissioning7500
49999-1005-14111102300105369ONE OFF PO FOR THE HIRING OF P2000KVA250
59999-1002-14111110818105370Transportation658
69999-1005-14111601405608526RENT OF 165KVA GENSET FOR 7 DAYS0
7TOTAL OF INVOICE ( VAT )8708VAT
89999-1002-14111301350307229Transportation987
99999-1002-14111301390307322Transportation of Genset180
109999-1002-14111301350308257TRANSPORTATION OF 200KVA TO KANO3000
11TOTAL OF INVOICE ( NO VAT )4167NO VAT
126101-0160-3P4191103318105362Oil Filter (1306)6867
136101-0262-3P4191103318105362Fuel Filter (1306)4515
146101-1010-3P4191103318105362Water Filter (1306)5670
156502-0034-34191103318105362Oil CI4 15W40 25Ltr. (1Ltr.)17325
169999-1003-14191103318105362Labour Charges17123
176101-0160-3P4191103318105363Oil Filter (1306)3622
18TOTAL OF INVOICE ( Maint. Contract )55122Maint.Contract
199999-1002-14111103560105365Transportation11541.7
209999-1002-14111103632105366Transportation6000.04
219999-1001-14111110522105367INSPECTION7500
229999-1001-14111102639105427INSPECTION7500
239999-1001-14111110522105496INSPECTION7500
249999-1001-14111605458608527INSPECTION FEE250
25TOTAL OF INVOICE ( On-Call/Repairs )40291.74On-Call/repairs
Sheet1 (2)
Excel 2010
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi. Try

Code:
Sub AFill()
Dim LR As Long
LR = Range("F" & Rows.Count).End(xlUp).Row
With Range("F2:F" & LR - 1)
    With .SpecialCells(xlCellTypeBlanks)
        .FormulaR1C1 = "=R[1]C"
    End With
    .Value = .Value
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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