Hi guys, need some help here!

maramos

New Member
Joined
Jan 9, 2023
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

Ik have found this it does almost what i need to do.

There is a formula row R11:Z11. VBA wil find the last empty rows and paste the formula there. The problem is that it does copy the exact row numbers starting row R11 then R12 etc.
I need it to just copy and use the row numbers where it is copied. I hope someone can help me with this.

Thanks,


Sub Fill_only_empty()

Dim LR As Long

LR = ActiveSheet.UsedRange.Find("*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row

With Range("R12:Z" & LR)
With .SpecialCells(xlCellTypeBlanks)
.Formula = Range("R11:Z11").Formula
End With
.Value = .Value
End With

End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Like: R11 =+YEAR(P11)&"-"&IF(MONTH(P11)<10;"0"&MONTH(P11);MONTH(P11))
 
Upvote 0
KPI CarrierShipping MonthKPI lineKPI Carrier countryKPI CountryKPI AllKPI Country + SalesorgKPI Carrier + SalesorgInv. Carrier + date
=IFERROR(VLOOKUP(H11;'C:\Users\maramos\Desktop\[FF - KPI T&T - Daily working file V4.xlsm]Carriers'!A:D;3;FALSE);"")=+YEAR(P11)&"-"&IF(MONTH(P11)<10;"0"&MONTH(P11);MONTH(P11))=+R11&S11&Q11=+R11&S11&Q11&F11=+IF(F11="SM";"IT";F11)&S11&Q11=+S11&Q11=+IF(F11="SM";"IT";F11)&S11&Q11&D11=+T11&D11=+R11&M11
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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