PDA

View Full Version : Solved: No of characters in a formula



danesrood
05-07-2010, 12:20 PM
Dear All

Does anyone know of a formula that will tell me the number of characters contained within a formula which includes a very long path to the files on our server.

To get an idea, I put a ' character in front of one of them and then used the Len function and it gave the answer of 384.

Many thanks for any help that you can provide.

Danesrood

GTO
05-07-2010, 12:42 PM
If there is a worksheet function to do this, I am unaware. Barely tested, but as a UDF, maybe:

Option Explicit

Public Function FormulaLen(FormulaCell As Range) As Long

FormulaLen = Len(CStr(FormulaCell.Formula))
End Function

This includes the equals sign.

Hope that helps,

Mark

danesrood
05-07-2010, 02:13 PM
GTO

Many thanks for your help.

I have tried it out as much as possible and it is looking good.

I'll try it with the actual files on Monday and let you know how it goes.

Again my thanks

Danesrood

danesrood
05-10-2010, 05:18 AM
GTO

I've had a chance now to try this out with the offending worksheets and it works a treat. Mind you its scary to see how many characters are on each sheet within the formulae

Thank you so much

Danesrood

GTO
05-10-2010, 05:35 AM
Happy to help and glad it worked :-)