Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default .Formula vs .FormulaR1C1 in 2007

Here's the problem. I have VBA inputting this formula in the same column
(col H) of cells:

..Formula =
"=if(trim(rc4)=""MS"",""MNGTS"",if(trim(rc4)=""MN" ",""MAINS"",""""))"

For a single user on Excel 2007 it appears in the cell as:

=if(Trim(RC4)="MS","MNGTS",if(trim(RC4)="MN","MAIN S",""))

When I change the .Formula to .FormulaR1C1 then the (RC4) becomes ($D2) on
row 2, which is correct.

The issue is other users of the same template with Excel 2007 don't have
this problem.

I also put in (rc[-4]), which also works, but I need to specifically
reference Col D so the column that has the formula may change.

Our office is slowly migrating to 2007 and since I do all the VBA
programming I'm still on 2003... Is there some setting that needs changing
in '07?
--
MacGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default .Formula vs .FormulaR1C1 in 2007

Also, might that cell be formatted as TEXT on the one users machine?
--
HTH,

Barb Reinhardt



"MacGuy" wrote:

Here's the problem. I have VBA inputting this formula in the same column
(col H) of cells:

.Formula =
"=if(trim(rc4)=""MS"",""MNGTS"",if(trim(rc4)=""MN" ",""MAINS"",""""))"

For a single user on Excel 2007 it appears in the cell as:

=if(Trim(RC4)="MS","MNGTS",if(trim(RC4)="MN","MAIN S",""))

When I change the .Formula to .FormulaR1C1 then the (RC4) becomes ($D2) on
row 2, which is correct.

The issue is other users of the same template with Excel 2007 don't have
this problem.

I also put in (rc[-4]), which also works, but I need to specifically
reference Col D so the column that has the formula may change.

Our office is slowly migrating to 2007 and since I do all the VBA
programming I'm still on 2003... Is there some setting that needs changing
in '07?
--
MacGuy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default .Formula vs .FormulaR1C1 in 2007

Barb,

thanks for the responses. I perform a text-to columns general format prior
to inputting the formula. I also checked the R1C1 reference style which is
not selected. I did turn it on to see the result but I'm getting the same
result, just in the R1C1 style.
--
MacGuy


"Barb Reinhardt" wrote:

Also, might that cell be formatted as TEXT on the one users machine?
--
HTH,

Barb Reinhardt



"MacGuy" wrote:

Here's the problem. I have VBA inputting this formula in the same column
(col H) of cells:

.Formula =
"=if(trim(rc4)=""MS"",""MNGTS"",if(trim(rc4)=""MN" ",""MAINS"",""""))"

For a single user on Excel 2007 it appears in the cell as:

=if(Trim(RC4)="MS","MNGTS",if(trim(RC4)="MN","MAIN S",""))

When I change the .Formula to .FormulaR1C1 then the (RC4) becomes ($D2) on
row 2, which is correct.

The issue is other users of the same template with Excel 2007 don't have
this problem.

I also put in (rc[-4]), which also works, but I need to specifically
reference Col D so the column that has the formula may change.

Our office is slowly migrating to 2007 and since I do all the VBA
programming I'm still on 2003... Is there some setting that needs changing
in '07?
--
MacGuy

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default .Formula vs .FormulaR1C1 in 2007

Is it possible that the one user has their default settings for formulas set
to R1C1 notation? Have them check under EXCEL OPTIONS - Formulas - R1C1
reference style is checked under Working with formulas.

In R1C1 reference style, if the formula is in row 2, RC4 converts to $D2.
What exactly do you want?
--
HTH,

Barb Reinhardt



"MacGuy" wrote:

Here's the problem. I have VBA inputting this formula in the same column
(col H) of cells:

.Formula =
"=if(trim(rc4)=""MS"",""MNGTS"",if(trim(rc4)=""MN" ",""MAINS"",""""))"

For a single user on Excel 2007 it appears in the cell as:

=if(Trim(RC4)="MS","MNGTS",if(trim(RC4)="MN","MAIN S",""))

When I change the .Formula to .FormulaR1C1 then the (RC4) becomes ($D2) on
row 2, which is correct.

The issue is other users of the same template with Excel 2007 don't have
this problem.

I also put in (rc[-4]), which also works, but I need to specifically
reference Col D so the column that has the formula may change.

Our office is slowly migrating to 2007 and since I do all the VBA
programming I'm still on 2003... Is there some setting that needs changing
in '07?
--
MacGuy

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default .Formula vs .FormulaR1C1 in 2007

It doesn't matter what the user is showing. It matters how you're creating the
formula.

If you're using R1C1 reference style (and you are), then you should use
..formular1c1

If you're using A1 reference style, then you should use .formula

Sometimes, excel will guess what you meant and fix the formula. Sometimes, it
won't. I don't know the rules it uses to determine how bad the formula is, so I
never let excel guess. I'll just use the correct property (.formula or
..formular1c1).



MacGuy wrote:

Here's the problem. I have VBA inputting this formula in the same column
(col H) of cells:

.Formula =
"=if(trim(rc4)=""MS"",""MNGTS"",if(trim(rc4)=""MN" ",""MAINS"",""""))"

For a single user on Excel 2007 it appears in the cell as:

=if(Trim(RC4)="MS","MNGTS",if(trim(RC4)="MN","MAIN S",""))

When I change the .Formula to .FormulaR1C1 then the (RC4) becomes ($D2) on
row 2, which is correct.

The issue is other users of the same template with Excel 2007 don't have
this problem.

I also put in (rc[-4]), which also works, but I need to specifically
reference Col D so the column that has the formula may change.

Our office is slowly migrating to 2007 and since I do all the VBA
programming I'm still on 2003... Is there some setting that needs changing
in '07?
--
MacGuy


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default .Formula vs .FormulaR1C1 in 2007

Dave,

Thanks for the reply. I don't like excel guessing for me either and if I
had known this I wouldn't have used .formula. What's gets me is I have 50+
users who don't have the same problem. Got some work to do.

Thanks again.
--
MacGuy


"Dave Peterson" wrote:

It doesn't matter what the user is showing. It matters how you're creating the
formula.

If you're using R1C1 reference style (and you are), then you should use
..formular1c1

If you're using A1 reference style, then you should use .formula

Sometimes, excel will guess what you meant and fix the formula. Sometimes, it
won't. I don't know the rules it uses to determine how bad the formula is, so I
never let excel guess. I'll just use the correct property (.formula or
..formular1c1).



MacGuy wrote:

Here's the problem. I have VBA inputting this formula in the same column
(col H) of cells:

.Formula =
"=if(trim(rc4)=""MS"",""MNGTS"",if(trim(rc4)=""MN" ",""MAINS"",""""))"

For a single user on Excel 2007 it appears in the cell as:

=if(Trim(RC4)="MS","MNGTS",if(trim(RC4)="MN","MAIN S",""))

When I change the .Formula to .FormulaR1C1 then the (RC4) becomes ($D2) on
row 2, which is correct.

The issue is other users of the same template with Excel 2007 don't have
this problem.

I also put in (rc[-4]), which also works, but I need to specifically
reference Col D so the column that has the formula may change.

Our office is slowly migrating to 2007 and since I do all the VBA
programming I'm still on 2003... Is there some setting that needs changing
in '07?
--
MacGuy


--

Dave Peterson
.

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
FormulaR1C1 ? Heather Excel Programming 4 September 16th 09 02:35 PM
Using Text in a Formula or FormulaR1C1 property Turtle_Todd Excel Programming 3 March 18th 09 07:12 PM
FormulaR1C1 v Formula Smallweed Excel Programming 1 October 1st 07 03:49 PM
What Does FormulaR1C1 Do? JLGWhiz Excel Programming 0 December 15th 06 12:19 AM
What Does FormulaR1C1 Do? Bob Phillips Excel Programming 0 December 14th 06 11:39 PM


All times are GMT +1. The time now is 03:40 PM.

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"