TortolaChris
Technical User
I am trying to write a VBA metric conversion function in Excel but am struggling with using Concatenate as a worksheet function within the code.
What I have so far is:
Function MetImp(Metric)
Prime = Metric / 25.4
Feet = WorksheetFunction.RoundDown(Prime / 12, 0)
Inch = WorksheetFunction.Round(Prime - (12 * Feet), 1)
and what I would like to end with is:
MetImp = WorksheetFunction.Concatenate(Feet,"' ",Inch,"''"
End Function
but it won't work!
It doesn't seem to like me writing Feet&"' "&Inch"''" either.
Has anyone got any ideas? I am really new to VBA so please don't be afraid of stating the obvious!
Thanks
Chris
What I have so far is:
Function MetImp(Metric)
Prime = Metric / 25.4
Feet = WorksheetFunction.RoundDown(Prime / 12, 0)
Inch = WorksheetFunction.Round(Prime - (12 * Feet), 1)
and what I would like to end with is:
MetImp = WorksheetFunction.Concatenate(Feet,"' ",Inch,"''"
End Function
but it won't work!
It doesn't seem to like me writing Feet&"' "&Inch"''" either.
Has anyone got any ideas? I am really new to VBA so please don't be afraid of stating the obvious!
Thanks
Chris