Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Using formula in code....Part 2!

Hi,

I am using the following formula, kindly provided on this forum) to return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

.... I get a syntax error message returned.

Anyone see what is wrong please?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using formula in code....Part 2!

Could it be that you're code is putting it in column 17 rather than 6 (=col
F). Perhaps column O is empty.

Regards
--
Glenton
www.leviqqio.com
Quality financial modelling


"Alan M" wrote:

Hi,

I am using the following formula, kindly provided on this forum) to return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

... I get a syntax error message returned.

Anyone see what is wrong please?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Using formula in code....Part 2!

The desitnation is actually column E so yes the formula should read
Cells(1,6) not 17 as you said...but that is irrelevant, the code is still
incorrect. It says:
Excecpted list seperator of ) and the point (.) is highlighted so the syntax
of the line is wrong somewhere

"glenton" wrote:

Could it be that you're code is putting it in column 17 rather than 6 (=col
F). Perhaps column O is empty.

Regards
--
Glenton
www.leviqqio.com
Quality financial modelling


"Alan M" wrote:

Hi,

I am using the following formula, kindly provided on this forum) to return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

... I get a syntax error message returned.

Anyone see what is wrong please?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Using formula in code....Part 2!

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 = _
"=MID(RC[-2],FIND(""."",RC[-2],1)-1,3)"



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Alan M" wrote in message
...
Hi,

I am using the following formula, kindly provided on this forum) to return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

... I get a syntax error message returned.

Anyone see what is wrong please?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Using formula in code....Part 2!

Hi Bob,


Thanks for the suggestion,
I spotted the double quote marks and included them but I am still receiving
the same message. ...."Expected list seperator or )" ...only this time the
cursor is at the end of the line of code rather than highlighting the point.



"Bob Phillips" wrote:

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 = _
"=MID(RC[-2],FIND(""."",RC[-2],1)-1,3)"



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Alan M" wrote in message
...
Hi,

I am using the following formula, kindly provided on this forum) to return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

... I get a syntax error message returned.

Anyone see what is wrong please?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Using formula in code....Part 2!

I tried it again and the code runs......however it places the FORMULA not the
resulting value in the destination range.

"Bob Phillips" wrote:

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 = _
"=MID(RC[-2],FIND(""."",RC[-2],1)-1,3)"



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Alan M" wrote in message
...
Hi,

I am using the following formula, kindly provided on this forum) to return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

... I get a syntax error message returned.

Anyone see what is wrong please?




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Using formula in code....Part 2!

With Range(Cells(1, 17), Cells(LastRow, 17))
.FormulaR1C1 = "=MID(RC[-2],FIND(""."",RC[-2],1)-1,3)"
.Value = .Value
End With


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Alan M" wrote in message
...
I tried it again and the code runs......however it places the FORMULA not
the
resulting value in the destination range.

"Bob Phillips" wrote:

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 = _
"=MID(RC[-2],FIND(""."",RC[-2],1)-1,3)"



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Alan M" wrote in message
...
Hi,

I am using the following formula, kindly provided on this forum) to
return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using
VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

... I get a syntax error message returned.

Anyone see what is wrong please?






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Using formula in code....Part 2!

Great. That one works a treat. Thanks Bob , please ignore the later question.
Problem solved.

"Bob Phillips" wrote:

With Range(Cells(1, 17), Cells(LastRow, 17))
.FormulaR1C1 = "=MID(RC[-2],FIND(""."",RC[-2],1)-1,3)"
.Value = .Value
End With


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Alan M" wrote in message
...
I tried it again and the code runs......however it places the FORMULA not
the
resulting value in the destination range.

"Bob Phillips" wrote:

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 = _
"=MID(RC[-2],FIND(""."",RC[-2],1)-1,3)"



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Alan M" wrote in message
...
Hi,

I am using the following formula, kindly provided on this forum) to
return
some code from a string in cell D1

=MID(D1,FIND(".",D1,1)-1,3)

However when I try to use this to set the formula in column F using
VBA
code as shown he

Range(Cells(1, 17), Cells(LastRow, 17)).FormulaR1C1 =
"=MID(RC[-2],FIND(".",RC[-2],1)-1,3)

... I get a syntax error message returned.

Anyone see what is wrong please?






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
Run Part of a Code If Q Sean Excel Programming 2 February 15th 07 07:26 AM
Need code to replace part of a range within a formula with a defined name Jeff[_50_] Excel Programming 2 May 2nd 06 10:59 PM
Formula for Extracting Alphabetic Part of a Product Code ob3ron02 Excel Worksheet Functions 5 October 30th 04 12:35 PM
Formula for Extracting Alphabetic Part of a Product Code ob3ron02 Excel Worksheet Functions 1 October 29th 04 07:05 PM
Formula for Extracting Alphabetic Part of a Product Code ob3ron02 Excel Worksheet Functions 1 October 29th 04 06:07 PM


All times are GMT +1. The time now is 10:33 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"