Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default instr problem with formula

I am trying to use the following

If InStr(1, "C:\", Range(strC & r).Formula) 0 Then
Print #1, r & strC & " " & " " & Range(strC & r).Formula
End If

strC = D
r = 21
Range(strC & r).Formula = "=(ISERROR(GET
PIVOTDATA("EQPSERIAL",'C:\Reports..........."

The print statement never happens.

Can anyone tell me what is wrong?

Thanks
--
Shell
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default instr problem with formula

There's another argument you can specify to make sure you don't have to worry
about upper/lower case.

vbTextCompare

Check VBA's help for instr and you'll see more info.

Maybe it's c:\ in the formula???

Or maybe you're looking at the wrong cell?

Shell wrote:

I am trying to use the following

If InStr(1, "C:\", Range(strC & r).Formula) 0 Then
Print #1, r & strC & " " & " " & Range(strC & r).Formula
End If

strC = D
r = 21
Range(strC & r).Formula = "=(ISERROR(GET
PIVOTDATA("EQPSERIAL",'C:\Reports..........."

The print statement never happens.

Can anyone tell me what is wrong?

Thanks
--
Shell


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default instr problem with formula

Your syntax on the InStr function is incomplete... as constructed, your
statement is looking for this...

"C:\", Range(strC & r).Formula

inside the string value of 1 (VB converts your number to a string). Why,
because you only specified two arguments to the InStr function. The first
argument is optional... it is the starting point for the search and defaults
to 1 when not specified. If you specify the starting position as a number,
then it must be followed by two string argument... the string to search
followed by the string being looked for. I can't give you a corrected
statement for you to look at because you didn't tell us what string you were
looking for inside of that path string.

--
Rick (MVP - Excel)


"Shell" wrote in message
...
I am trying to use the following

If InStr(1, "C:\", Range(strC & r).Formula) 0 Then
Print #1, r & strC & " " & " " & Range(strC & r).Formula
End If

strC = D
r = 21
Range(strC & r).Formula = "=(ISERROR(GET
PIVOTDATA("EQPSERIAL",'C:\Reports..........."

The print statement never happens.

Can anyone tell me what is wrong?

Thanks
--
Shell


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default instr problem with formula

I solved it.
--
Shell


"Shell" wrote:

I am trying to use the following

If InStr(1, "C:\", Range(strC & r).Formula) 0 Then
Print #1, r & strC & " " & " " & Range(strC & r).Formula
End If

strC = D
r = 21
Range(strC & r).Formula = "=(ISERROR(GET
PIVOTDATA("EQPSERIAL",'C:\Reports..........."

The print statement never happens.

Can anyone tell me what is wrong?

Thanks
--
Shell

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
Use InStr function in formula? Lee Hunter Excel Worksheet Functions 8 May 8th 23 03:45 AM
Len and InStr problem manipulating strings facmanboss Excel Programming 3 February 22nd 09 03:37 PM
Problem using the INSTR function in VBA [email protected] Excel Programming 1 March 23rd 07 08:12 AM
InStr FGM Excel Programming 3 July 14th 05 08:47 PM
Instr function problem Ross Withey Excel Programming 9 November 14th 03 08:02 AM


All times are GMT +1. The time now is 10:28 PM.

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

About Us

"It's about Microsoft Excel"