copy formula from last populated cell in row

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,604
Office Version
  1. 365
Platform
  1. Windows
Hi all

can somebody show me how I can search through row 8 of my 'sheet1' to find the last populated cell, then copy the formula of that cell into the next cell.

for example if E8 is last populated cell then copy the formula in E8 into E9

thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Paste this code into your Sheet Module then just Double-Clicj the Row you wish for this action to take place..


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
LC = Cells(Target.Row, Columns.Count).End(xlToLeft).Column
Cells(Target.Row, LC).Copy Destination:=Cells(Target.Row + 1, LC)
End Sub
 
Upvote 0
Hi Jim

Can this be done without having to double click on the row?
reason I ask is that this procedure will form part of a bigger routine

thanks
 
Upvote 0
In a standard Module enter - Before running click on the row of interest..

Code:
Sub Foo()
LC = Cells(ActiveCell.Row, Columns.Count).End(xlToLeft).Column
Cells(ActiveCell.Row, LC).Copy Destination:=Cells(ActiveCell.Row + 1, LC)
End Sub
 
Upvote 0
sorry my mistake...

for example if E8 is last populated cell then copy the formula in E8 into E9

I meant copy formula from E8 into F8, ie next cell along

thanks
 
Upvote 0

Forum statistics

Threads
1,224,596
Messages
6,179,807
Members
452,944
Latest member
2558216095

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