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.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,961
Messages
5,856,531
Members
431,819
Latest member
Tori Murphy

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