Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default A code problem with short Estimating worksheets

This is the problem code sequence:

Range("E" & EndToCollectionRow).Formula = _
"=sum(E" & StartToCollectionRow & ":E" & EndToCollectionRow - 1 & ")"
Range("F" & EndToCollectionRow).Formula = _
"=sum(F" & StartToCollectionRow & ":F" & EndToCollectionRow - 1 & ")"
Range("G" & EndToCollectionRow).Formula = _
"=sum(G" & StartToCollectionRow & ":G" & EndToCollectionRow - 1 & ")"
etc
Range("O" & EndToCollectionRow + 1).Formula = _
"=sum(O" & StartToCollectionRow & ":O" & EndToCollectionRow - 1 & ")"

An error is generated on the line ...Range("O..... ) etc, with the
message
Method Range of Object_Global failed.

EndToCollectionRow holds the value 65536, so hence the error.

Working back through the routine, this is the code that sets the variable
EndToCollectionRow:

TargetCell = Columns(ActiveCell.Column).Find(What:="£", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Select
EndToCollectionRow = ActiveCell.Row

For some reason, even though there is a later '£' value, the code 'misses'
it
and finds 65536.

Can anyone help, or would anyone be prepared to accept a small
attachment with a complete data/code example, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 14/07/2003


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default A code problem with short Estimating worksheets

would be happy to look at the attachment... suspect it can be done an easier
way.

Mark D

"Stuart" wrote in message
...
This is the problem code sequence:

Range("E" & EndToCollectionRow).Formula = _
"=sum(E" & StartToCollectionRow & ":E" & EndToCollectionRow - 1 & ")"
Range("F" & EndToCollectionRow).Formula = _
"=sum(F" & StartToCollectionRow & ":F" & EndToCollectionRow - 1 & ")"
Range("G" & EndToCollectionRow).Formula = _
"=sum(G" & StartToCollectionRow & ":G" & EndToCollectionRow - 1 & ")"
etc
Range("O" & EndToCollectionRow + 1).Formula = _
"=sum(O" & StartToCollectionRow & ":O" & EndToCollectionRow - 1 & ")"

An error is generated on the line ...Range("O..... ) etc, with the
message
Method Range of Object_Global failed.

EndToCollectionRow holds the value 65536, so hence the error.

Working back through the routine, this is the code that sets the variable
EndToCollectionRow:

TargetCell = Columns(ActiveCell.Column).Find(What:="£", After:=ActiveCell,

_
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Select
EndToCollectionRow = ActiveCell.Row

For some reason, even though there is a later '£' value, the code 'misses'
it
and finds 65536.

Can anyone help, or would anyone be prepared to accept a small
attachment with a complete data/code example, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 14/07/2003




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
Sheet metal estimating problem rudyeb Excel Discussion (Misc queries) 3 May 16th 08 11:17 AM
Can I short worksheets ascending or descending order ? Jitender Kadyan Excel Worksheet Functions 1 August 25th 07 08:54 AM
How do I alpha short worksheets in a workbook: efward1 Excel Worksheet Functions 5 June 8th 06 11:27 PM
Short cut for switching between worksheets Paul Gignac Excel Worksheet Functions 2 March 22nd 06 08:37 PM
Is there a short cut to switch between worksheets? Kelli K. Excel Worksheet Functions 1 October 29th 04 11:11 PM


All times are GMT +1. The time now is 12:31 PM.

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"