ankita.sethi
Board Regular
- Joined
- Apr 27, 2011
- Messages
- 58
Hi,
i am writing a code to find a text in a particular row in excel. The problem is that the text exists with Shift+Enter in it twice (manual line break).
The text is "Ave Speed of Answer"; but entered like this:
Ave
Speed
of Answer
I have tried the following:
ASA = Range("A11:Z11").Find("AveSpeedof Answer", Range("A11"), xlValues, xlWhole, xlByColumns, xlNext).Column
Also:
ASA = Range("A11:Z11").Find("Ave" & Chr(11) & "Speed" & Chr(11) & "of Answer", Range("A11"), xlValues, xlWhole, xlByColumns, xlNext).Column
It gives the error "Object Variable or With Block Variable not set". In my experience, this error pops up when it cannot find the text.
Please help!!
i am writing a code to find a text in a particular row in excel. The problem is that the text exists with Shift+Enter in it twice (manual line break).
The text is "Ave Speed of Answer"; but entered like this:
Ave
Speed
of Answer
I have tried the following:
ASA = Range("A11:Z11").Find("AveSpeedof Answer", Range("A11"), xlValues, xlWhole, xlByColumns, xlNext).Column
Also:
ASA = Range("A11:Z11").Find("Ave" & Chr(11) & "Speed" & Chr(11) & "of Answer", Range("A11"), xlValues, xlWhole, xlByColumns, xlNext).Column
It gives the error "Object Variable or With Block Variable not set". In my experience, this error pops up when it cannot find the text.
Please help!!