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.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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.
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,576
Members
448,972
Latest member
Shantanu2024

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