Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Networkdays formula in macro

Hi:
I want to write the statement ActiveCell = "=NETWORKDAYS(I2,O2)"
replacing I2 with ActiveCell.Offset(0,-9) and O2 with
(ActiveCell.Offset(0,-3). My string below gives me the error #NAME?

ActiveCell =
"=NETWORKDAYS((ActiveCell.Offset(0,-9)),(ActiveCell.Offset(0,-3))"


Could anyone help me please.

Thanks,
Orquidea
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Networkdays formula in macro

maybe...

ActiveCell.formula = "=NETWORKDAYS(" & ActiveCell.Offset(0, -9).Address(0, 0) _
& "," & ActiveCell.Offset(0, -3).Address(0, 0) & ")"



orquidea wrote:

Hi:
I want to write the statement ActiveCell = "=NETWORKDAYS(I2,O2)"
replacing I2 with ActiveCell.Offset(0,-9) and O2 with
(ActiveCell.Offset(0,-3). My string below gives me the error #NAME?

ActiveCell =
"=NETWORKDAYS((ActiveCell.Offset(0,-9)),(ActiveCell.Offset(0,-3))"

Could anyone help me please.

Thanks,
Orquidea


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Networkdays formula in macro

Hi,

I'm not sure what values you intend to put in these 2 offset cells but try
this

ActiveCell = "=NETWORKDAYS(" & ActiveCell.Offset(0, -9).Value & "," &
ActiveCell.Offset(0, -3).Value & ")"

The answer has line-wrapped

Mike

"orquidea" wrote:

Hi:
I want to write the statement ActiveCell = "=NETWORKDAYS(I2,O2)"
replacing I2 with ActiveCell.Offset(0,-9) and O2 with
(ActiveCell.Offset(0,-3). My string below gives me the error #NAME?

ActiveCell =
"=NETWORKDAYS((ActiveCell.Offset(0,-9)),(ActiveCell.Offset(0,-3))"


Could anyone help me please.

Thanks,
Orquidea

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Networkdays formula in macro

Thanks Mike:

I tried your string but it gives me result 0.

I2 (ActiveCell.Offset(0,-9) = 05/30/08 and O2(ActiveCell.Offset(0,-3)=
06/02/08. The result I should get is 2.

Orquidea

"Mike H" wrote:

Hi,

I'm not sure what values you intend to put in these 2 offset cells but try
this

ActiveCell = "=NETWORKDAYS(" & ActiveCell.Offset(0, -9).Value & "," &
ActiveCell.Offset(0, -3).Value & ")"

The answer has line-wrapped

Mike

"orquidea" wrote:

Hi:
I want to write the statement ActiveCell = "=NETWORKDAYS(I2,O2)"
replacing I2 with ActiveCell.Offset(0,-9) and O2 with
(ActiveCell.Offset(0,-3). My string below gives me the error #NAME?

ActiveCell =
"=NETWORKDAYS((ActiveCell.Offset(0,-9)),(ActiveCell.Offset(0,-3))"


Could anyone help me please.

Thanks,
Orquidea

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Networkdays formula in macro

Hi,

The formula I gave you works fine if the offset cells contain cell
references but you never said what you were using. This works for dates in
those cells. Note the additional quotes.

ActiveCell = "=NETWORKDAYS(""" & ActiveCell.Offset(0, -9) & """,""" &
ActiveCell.Offset(0, -3) & """)"

Mike

"orquidea" wrote:

Thanks Mike:

I tried your string but it gives me result 0.

I2 (ActiveCell.Offset(0,-9) = 05/30/08 and O2(ActiveCell.Offset(0,-3)=
06/02/08. The result I should get is 2.

Orquidea

"Mike H" wrote:

Hi,

I'm not sure what values you intend to put in these 2 offset cells but try
this

ActiveCell = "=NETWORKDAYS(" & ActiveCell.Offset(0, -9).Value & "," &
ActiveCell.Offset(0, -3).Value & ")"

The answer has line-wrapped

Mike

"orquidea" wrote:

Hi:
I want to write the statement ActiveCell = "=NETWORKDAYS(I2,O2)"
replacing I2 with ActiveCell.Offset(0,-9) and O2 with
(ActiveCell.Offset(0,-3). My string below gives me the error #NAME?

ActiveCell =
"=NETWORKDAYS((ActiveCell.Offset(0,-9)),(ActiveCell.Offset(0,-3))"


Could anyone help me please.

Thanks,
Orquidea



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Networkdays formula in macro

My mistake, I assumed that NETWORKDAYS just workes with dates, I guess not.
Thanks, It works now.

"Mike H" wrote:

Hi,

The formula I gave you works fine if the offset cells contain cell
references but you never said what you were using. This works for dates in
those cells. Note the additional quotes.

ActiveCell = "=NETWORKDAYS(""" & ActiveCell.Offset(0, -9) & """,""" &
ActiveCell.Offset(0, -3) & """)"

Mike

"orquidea" wrote:

Thanks Mike:

I tried your string but it gives me result 0.

I2 (ActiveCell.Offset(0,-9) = 05/30/08 and O2(ActiveCell.Offset(0,-3)=
06/02/08. The result I should get is 2.

Orquidea

"Mike H" wrote:

Hi,

I'm not sure what values you intend to put in these 2 offset cells but try
this

ActiveCell = "=NETWORKDAYS(" & ActiveCell.Offset(0, -9).Value & "," &
ActiveCell.Offset(0, -3).Value & ")"

The answer has line-wrapped

Mike

"orquidea" wrote:

Hi:
I want to write the statement ActiveCell = "=NETWORKDAYS(I2,O2)"
replacing I2 with ActiveCell.Offset(0,-9) and O2 with
(ActiveCell.Offset(0,-3). My string below gives me the error #NAME?

ActiveCell =
"=NETWORKDAYS((ActiveCell.Offset(0,-9)),(ActiveCell.Offset(0,-3))"


Could anyone help me please.

Thanks,
Orquidea

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Networkdays formula in macro

Hi,

Networkdays works with dates directly or with cell references that refer to
dates but if using dates directly extra quotes are needed. Thanks for the
feedback.

Mike

"orquidea" wrote:

My mistake, I assumed that NETWORKDAYS just workes with dates, I guess not.
Thanks, It works now.

"Mike H" wrote:

Hi,

The formula I gave you works fine if the offset cells contain cell
references but you never said what you were using. This works for dates in
those cells. Note the additional quotes.

ActiveCell = "=NETWORKDAYS(""" & ActiveCell.Offset(0, -9) & """,""" &
ActiveCell.Offset(0, -3) & """)"

Mike

"orquidea" wrote:

Thanks Mike:

I tried your string but it gives me result 0.

I2 (ActiveCell.Offset(0,-9) = 05/30/08 and O2(ActiveCell.Offset(0,-3)=
06/02/08. The result I should get is 2.

Orquidea

"Mike H" wrote:

Hi,

I'm not sure what values you intend to put in these 2 offset cells but try
this

ActiveCell = "=NETWORKDAYS(" & ActiveCell.Offset(0, -9).Value & "," &
ActiveCell.Offset(0, -3).Value & ")"

The answer has line-wrapped

Mike

"orquidea" wrote:

Hi:
I want to write the statement ActiveCell = "=NETWORKDAYS(I2,O2)"
replacing I2 with ActiveCell.Offset(0,-9) and O2 with
(ActiveCell.Offset(0,-3). My string below gives me the error #NAME?

ActiveCell =
"=NETWORKDAYS((ActiveCell.Offset(0,-9)),(ActiveCell.Offset(0,-3))"


Could anyone help me please.

Thanks,
Orquidea

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
NETWORKDAYS formula orquidea Excel Discussion (Misc queries) 5 February 15th 08 07:43 PM
need help with networkdays formula aashishtaneja Excel Worksheet Functions 1 September 5th 07 01:06 PM
Networkdays formula Silvie4 Excel Worksheet Functions 4 June 14th 06 09:14 PM
NETWORKDAYS FORMULA Lichase Excel Worksheet Functions 1 June 9th 05 09:24 PM
NETWORKDAYS help with the formula Zoeb1979 Excel Discussion (Misc queries) 1 May 9th 05 03:13 PM


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