First off I am not expert in this area.
I am using excel 2000 on WinXP Pro SP2.
I have used a vba
function for calculating like NetworkDays function except this custom function (NetworkDaysMisc) can calculate the number
working week weekdays that you specify (e.g Mon to Sat). Code can be found here ->
this works very well and does what I want. Then under the
doubleclick subroutine of the worksheet I have code to add and remove rows depending on what the cells contents is. Here is
Dim DeleteRow As Boolean
DeleteRow = False
If ActiveCell = "Double click here to add SR" Then
ActiveCell = "New SR Entry"
'ActiveCell.Font.Italic = True
'ActiveCell.Font.ColorIndex = 15
DeleteRow = True
If ActiveCell = "New SR Entry" And DeleteRow Then
Ok. Now on my spreadsheet I have a cell to calculate my number of working days of a date range using the vba function like I
first stated. The cell formula looks like this
the problem I am experiencing that I hope someone can help me with please. When I double click my cell with contents of
"Double click here to add SR" and new row is inserted above that cell. And the cell that uses the vba function to
calculate the workdays displays correct value. But then if I double click the cell with contents "New SR Entry"
that is in the newly created row, the row deletes as it should but now the cell calculating the networkdaysmisc becomes
#VALID!. And I cant work out why? If I go to the cell using the networkdaysmisc function I find the reference cells and
ranges are correct and so all I need to do on this cell is enter edit mode (F2 key) then press enter and is now display
I have tried moving/relocating the cell reporting the networkdays up above where the rows can be added
and deleted but this make no difference. So it make me think that something like vba code needs to be restarted. I dont
I figure I need to add some code, or the sheet is not refreshing/updating. Can anyone figure this
out and help me?
I have though of vba code to move to this problem cell (ActiveCell.Offset(2,0).Select) and
simulate the F2 and enter keys. But there must be a better way and a reason why this happen and how to avoid this
Thanks in advance,