What would this be in VBA code?
If Len(Trim(rngGridCell)) - Len(Substitute(rngGridCell, " ", "")) + 1 < 28 Then
When I try to run it like that it tells me "sub or Function not defined"
Thanks!
Printable View
What would this be in VBA code?
If Len(Trim(rngGridCell)) - Len(Substitute(rngGridCell, " ", "")) + 1 < 28 Then
When I try to run it like that it tells me "sub or Function not defined"
Thanks!
you need the REPLACE function.
Idon't think that will work, I want to first count the length of the charachters in the cell, then i want to remove all of the blank spaces and subtract that by the original length.
that would give me how many names were in the cell.
I need to be able to replace specific instances (ie. " " with ""), I don't think replace lets me do that?
Yes, it will let you do that. Here's an example.
VB Code:
Sub SampleReplace() Dim sInput As String Dim sOutput As String sInput = "This is a Test" sOutput = Replace(sInput, " ", "") MsgBox sOutput End Sub
Eureka!