VBA CODE TO FIND LAST CELL AND FILL FORMULA IN NEXT COLUMN UPTO END.

SAQIBN

New Member
Joined
Oct 16, 2021
Messages
20
Office Version
  1. 2013
Platform
  1. Windows
Dear All,
I want a VBA Solution for following please.

I have a data list in A2:A200, (It will Change Every time), and a Formula in B1.

I want to find last Filled Cell from Column A, (i.e A200)
and to Copy Formula From B1 in B2:B200.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try this:
VBA Code:
Sub Test()
Range("B1").AutoFill Destination:=Range("B1:B" & Range("A" & Rows.Count).End(xlUp).Row)
End Sub
OR
VBA Code:
Sub Test()
Range("B1:B" & Range("A" & Rows.Count).End(xlUp).Row).FillDown
End Sub
 
Upvote 0
Solution
Try this:
VBA Code:
Sub Test()
Range("B1").AutoFill Destination:=Range("B1:B" & Range("A" & Rows.Count).End(xlUp).Row)
End Sub
OR
VBA Code:
Sub Test()
Range("B1:B" & Range("A" & Rows.Count).End(xlUp).Row).FillDown
End Sub

OMG.... Thanks you soooooooooooo much......
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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