Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Copying row into new sheet if it contains certain text

Auric__ wrote :
GS wrote:

Auric__ laid this down on his screen :
GS wrote:

You might want to get into the habit of specifying a value since InStr
can result unexpected behavior if you assume it's return value is
equal to vbFalse...

If InStr(rngC, "Milka") 0 Then

I generally just go by the old standby, "0 is false, anything else is
true." It's been working for ~29 years now...


That's safe in VB but VBA will bite you with that assumption!


Clarify please? I have several places where I use InStr(x, y) as an implied
boolean value, and have never noticed a problem.


See Karl's explanation under the topic "Boolean games" in
microsoft.public.vb.general for clarification of my point. Clearly it
doesn't apply to your usage here, but Karl notes the exceptions where
it doesn't work in VB/VBA as expected.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying text on sheet 1 to corresponding cells on sheets 2 to 5 Lisa New Users to Excel 5 October 1st 08 06:01 AM
copying data from text file to excel sheet sreedhar[_15_] Excel Programming 1 October 17th 05 01:25 PM
Copying cells from on sheet to another sheet (via sheet module) CRayF Excel Programming 6 September 20th 05 08:58 PM
Long Text in merged cells not copying correctly with sheet Dave Peterson[_3_] Excel Programming 0 August 21st 04 12:44 AM
Copying text from a text box into a cell on another sheet cakonopka Excel Programming 1 January 22nd 04 07:57 PM


All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"