Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default help with generating a percentage value

Hi,

I have a simple program that scrolls through a row collecting numbers,
at various points in the row i am trying to calulate a percentage.

i keep getting an error with the below code, (not very advanced)

Range("f9").Select
Do Until ActiveCell = ""
Selection.Offset(0, 1).Select
volume = ActiveCell
Selection.Offset(0, 1).Select
comp = ActiveCell
Selection.Offset(0, 1).Select
compercent = comp / volume * 100 (this is where it debugs to giving
me an overflow error)
activecell = compercent



I have tried declaring my variables as integers and long still no joy

any help would be great

John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default help with generating a percentage value

On Tuesday, March 13, 2012 6:07:41 AM UTC-5, wrote:
Hi,

I have a simple program that scrolls through a row collecting numbers,
at various points in the row i am trying to calulate a percentage.

i keep getting an error with the below code, (not very advanced)

Range("f9").Select
Do Until ActiveCell = ""
Selection.Offset(0, 1).Select
volume = ActiveCell
Selection.Offset(0, 1).Select
comp = ActiveCell
Selection.Offset(0, 1).Select
compercent = comp / volume * 100 (this is where it debugs to giving
me an overflow error)
activecell = compercent



I have tried declaring my variables as integers and long still no joy

any help would be great

John


KISS

range("i9").value = range("g9")/range("h9")* 100


Range("f9").Select
Do Until ActiveCell = ""
Selection.Offset(0, 1).Select
volume = ActiveCell
Selection.Offset(0, 1).Select
comp = ActiveCell
Selection.Offset(0, 1).Select
compercent = comp / volume * 100 (this is where it debugs to giving
me an overflow error)
activecell = compercent
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default help with generating a percentage value

On Mar 13, 11:40*am, Don Guillett wrote:
On Tuesday, March 13, 2012 6:07:41 AM UTC-5, wrote:
Hi,


I have a simple program that scrolls through a row collecting numbers,
at various points in the row i am trying to calulate a percentage.


i keep getting an error with the below code, (not very advanced)


Range("f9").Select
* Do Until ActiveCell = ""
* Selection.Offset(0, 1).Select
* volume = ActiveCell
* Selection.Offset(0, 1).Select
* comp = ActiveCell
* Selection.Offset(0, 1).Select
* compercent = comp / volume * 100 *(this is where it debugs to giving
me an overflow error)
activecell = compercent


I have tried declaring my variables as integers and long still no joy


any help would be great


John


KISS

range("i9").value = range("g9")/range("h9")* 100

Range("f9").Select
* Do Until ActiveCell = ""
* Selection.Offset(0, 1).Select
* volume = ActiveCell
* Selection.Offset(0, 1).Select
* comp = ActiveCell
* Selection.Offset(0, 1).Select
* compercent = comp / volume * 100 *(this is where it debugs to giving
me an overflow error)
activecell = compercent- Hide quoted text -

- Show quoted text -


sorry i forgot part of the code

Range("f9").Select
Do Until ActiveCell = ""
Selection.Offset(0, 1).Select
volume = ActiveCell
Selection.Offset(0, 1).Select
comp = ActiveCell
Selection.Offset(0, 1).Select
compercent = comp / volume * 100 (this is where it debugs to
giving
me an overflow error)
activecell = compercent
activecell.offset(0,1).select
loop

the code loops through the cells picking up the values and adding a
percentage, until it comes to the end of the list

many thanks








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default help with generating a percentage value

On Mar 13, 11:40*am, Don Guillett wrote:
On Tuesday, March 13, 2012 6:07:41 AM UTC-5, wrote:
Hi,


I have a simple program that scrolls through a row collecting numbers,
at various points in the row i am trying to calulate a percentage.


i keep getting an error with the below code, (not very advanced)


Range("f9").Select
* Do Until ActiveCell = ""
* Selection.Offset(0, 1).Select
* volume = ActiveCell
* Selection.Offset(0, 1).Select
* comp = ActiveCell
* Selection.Offset(0, 1).Select
* compercent = comp / volume * 100 *(this is where it debugs to giving
me an overflow error)
activecell = compercent


I have tried declaring my variables as integers and long still no joy


any help would be great


John


KISS

range("i9").value = range("g9")/range("h9")* 100

Range("f9").Select
* Do Until ActiveCell = ""
* Selection.Offset(0, 1).Select
* volume = ActiveCell
* Selection.Offset(0, 1).Select
* comp = ActiveCell
* Selection.Offset(0, 1).Select
* compercent = comp / volume * 100 *(this is where it debugs to giving
me an overflow error)
activecell = compercent- Hide quoted text -

- Show quoted text -


Hi

Thanks

sorry i fogot a bit of my code

Range("f9").Select
Do Until ActiveCell = ""
Selection.Offset(0, 1).Select
volume = ActiveCell
Selection.Offset(0, 1).Select
comp = ActiveCell
Selection.Offset(0, 1).Select
compercent = comp / volume * 100 (this is where it debugs to
giving
me an overflow error)
activecell = compercent
Selection.Offset(0, 1).Select
loop


The code loops through alot of cells adding percentages as it goes,
hence why i have used variables

thanks




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
generating a #VALUE Smallweed Excel Programming 4 September 28th 07 01:58 PM
Generating a list Dave[_3_] Excel Worksheet Functions 1 April 4th 07 12:35 AM
Calculating a percentage with the end percentage in mind Shadowshady Excel Discussion (Misc queries) 2 June 17th 06 09:41 AM
Bar Chart depicting the "percentage of another percentage(less than 100)" TEAM Charts and Charting in Excel 1 October 28th 05 05:06 AM
Generating a percentage... Steel Bananana Excel Discussion (Misc queries) 2 December 20th 04 07:12 PM


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