Using the same formula for each row of a worksheet

litestream

Active Member
Joined
Jul 24, 2006
Messages
323
In cell F2, I use a procedure called RemoveNumeric(D2) which removes the numerals from an alphanumeric stock code contained in cell D2 leaving me with the portion of the code that relates to a specific client.

Function RemoveNumeric(Rng As String) As String
Dim Tmp As String
Dim i As Integer

Tmp = Rng
For i = 0 To 9
Tmp = Application.Substitute(Tmp, i, "")
Next i
RemoveNumeric = Tmp
End Function

How can I apply this to each row of my worksheet in column F, bearing in mind that I continually add and remove stock lines from my sheet, short of pasting it into each cell regardless of whether the line is populated with data or not?

The top row of the worksheet contains column headings.
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

litestream

Active Member
Joined
Jul 24, 2006
Messages
323
Is it not possible to make an entire row contain the same formula for each row, regardless of whether it is populated with data at the time or not?

The ASAP Utilities macro assumes that all the cells contain data.

I am constructing a stock control worksheet and rows are inserted and deleted as and when stock changes.
 

patrickmuldoon99

Active Member
Joined
Jun 27, 2006
Messages
345
What is the problem if the cell does not have data? Surely it would just return an empty string into the cell where the formula sits?
 

Watch MrExcel Video

Forum statistics

Threads
1,123,271
Messages
5,600,650
Members
414,399
Latest member
Ninjee

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