Copy Formula to Active Rows Only

DC0429

New Member
Joined
Jan 27, 2010
Messages
27
Need help with the following please... Looking for a way to have a pre-determined formula populate cells in Column K if cells in Column A have data. So, if A2 has data, I need a formula in K2. Formula for K3 if A3 has data (same formula) and so on. I would prefer not to use a typical formula such as "=IF(A2<>"",X,Y)" since this has the potential to cover 1000+ rows. Additionally, we will be deleting rows as they become old and/or obsolete. Any help would be greatly appreciated.
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Redwolfx

Well-known Member
Joined
Feb 22, 2013
Messages
1,161
Try:

This will get you up to 5000 Lines

Code:
Sub Formula()
Dim Formula As String
Dim Mycell As Range
Dim EOS As Long

EOS = Worksheets("Sheet1").Range("A5000").End(xlUp).Row

Formula = Enter your Formula Here"

For Each Mycell In Worksheets("Sheet1").Range("A2:A" & EOS)
    If Mycell.Value <> "" Then
        Mycell(1, 11).Value = Formula
    End If
Next Mycell
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,514
Messages
5,596,612
Members
414,080
Latest member
penguin23

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
Top