Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default Inserting the values of a formula using vb

HI All,

Do you know where the error is below

Thanks for any help

With Worksheets("tblFaxMailBox").Range("F2:F" & LASTROW)
.Formula=
"= NETWORKDAYS(RC[-2],RC[-4],Holiday!R2C[-4]:R11C[-4])"
.Value = .Value
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default Inserting the values of a formula using vb

HI I found the error. I needed to add R1C1

"ram" wrote:

HI All,

Do you know where the error is below

Thanks for any help

With Worksheets("tblFaxMailBox").Range("F2:F" & LASTROW)
.Formula=
"= NETWORKDAYS(RC[-2],RC[-4],Holiday!R2C[-4]:R11C[-4])"
.Value = .Value
End With

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Inserting the values of a formula using vb

Hi,

There's nothing wrong with the code so you should look at how your setting a
value for LastRow. It should be something like

LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row

or you may choose to use column D


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"ram" wrote:

HI All,

Do you know where the error is below

Thanks for any help

With Worksheets("tblFaxMailBox").Range("F2:F" & LASTROW)
.Formula=
"= NETWORKDAYS(RC[-2],RC[-4],Holiday!R2C[-4]:R11C[-4])"
.Value = .Value
End With

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Inserting the values of a formula using vb

If you're going to use that R1C1 reference style, then make sure you use:
.formulaR1C1 =

Not
.formula =



ram wrote:

HI All,

Do you know where the error is below

Thanks for any help

With Worksheets("tblFaxMailBox").Range("F2:F" & LASTROW)
.Formula=
"= NETWORKDAYS(RC[-2],RC[-4],Holiday!R2C[-4]:R11C[-4])"
.Value = .Value
End With


--

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
Extracting Values and inserting Rows/Values VexedFist[_2_] Excel Programming 3 April 22nd 08 02:37 PM
Inserting rows without changing formula values Hook''em 2006 Excel Worksheet Functions 5 December 27th 06 09:45 PM
Inserting a cell changes my formula values shallina Excel Worksheet Functions 2 August 18th 06 05:42 PM
Inserting values Tom Ogilvy Excel Programming 0 September 7th 03 01:32 AM
Inserting values Chip Pearson Excel Programming 0 September 7th 03 01:20 AM


All times are GMT +1. The time now is 09:47 AM.

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"