LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default Code for dealing with #REF

I think the end of it should go like this:

..Cells(RowToFind, ColToFind) = _
"=Sum(" & Cells(RowToFind, 5).Address(False, False) & ":" & _
Cells(RowToFind, ColToFind - 1).Address(False, False) & ")"

The False's after Address made the references relative. You can drop them
and the parens they are in if you want absolute references.

--
Jim
"Kevin Porter" wrote in message
...
| Yes, reading back over it, it is a bit obscure. Let's try again, because
the
| second one is close to what I need.
|
| I am writing code that looks at a specific cell (RowToFind,ColToFind) and
| checks if it has an error condition, in this case I know it will be a #REF
| error. If it is errored then I want to sum all cells from (RowToFind, 5)
to
| (RowToFind, ColToFind - 1) and write that number into (RowToFind,
ColToFind).
| The following is the code I tried:
|
| If IsError(Cells(RowToFind, ColToFind)) Then Workbooks("SRA Detailed
Payroll
| - " & WBDate & ".xls").Sheets("Shreveport").Cells(RowToFind, ColToFind) =
| "=Sum(cells(RowToFind, 5):cells(rowtofind, coltofind[-1]))"
|
|
| I think I am ok up to the =Sum command.
|
| Thanks again for your help and patience.


 
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
Dealing with #VALUE! Maracay Excel Discussion (Misc queries) 3 February 10th 09 03:35 PM
dealing with time Rhydderch Excel Worksheet Functions 5 January 12th 09 11:37 PM
Dealing with +/- Values, Need Help Dust Devil Excel Worksheet Functions 1 April 18th 08 11:02 PM
card dealing RobcPettit[_2_] Excel Programming 4 November 28th 06 08:52 AM
Dealing with pop-ups Jasons Excel Programming 1 November 7th 04 07:43 PM


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