Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Please debug this one formula in VB

I didn't intend to use these long formulas in my vb
script. But on this one occassion, it is absolutely
necessary. I have live spreadsheet ranges that are
calculating what line the active cell is and I have to
capture that number at the appropriate time in order to do
the right string for this one line. So, at the point I
have this formula is the precise moment in the script
where I need to pass the value of this formula

The way it is here it beeps at me at me with the message
of a compile error. And I've worked and I've listened to
how Bob and Tom said it works, but I still don't get it,
at least not for this long a formula anyway. So, please
just copy, paste, and edit as necessary to show me the
proper syntax in this case.

ActiveCell.Formula = "=IF(FIXED(INDEX("&Range("Summary")
&","&Range("ROWSUM"&"+1,2),0,TRUE)" _
=INDEX("&Range("Summary")&","&Range("ROWSUM")
&"+1,1),="SE~"&FIXED(Range("LINES1")&",0,TRUE)"&"~ 0001, _
SE~"&"FIXED("Range("LINES1")-Range("LINES2")&",0)~0001)"

Otherwise, I will continue to be extremely frustrated
trying to learn it by trial and error.

Thanks,


Bruce

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Please debug this one formula in VB

"=IF(FIXED(INDEX("&Range("Summary")
says to append the value in the range("Summary") to the preceding string. I
doubt that is what you want. But with such ambiguities as this, it would be
hard to tell what works and what doesn't.

Show us what a working identical worksheet formula looks like (what your end
result would be) and then someone might be able to tell you if there is a
problem with your string.

Regards,
Tom Ogilvy


"Bruce Roberson" wrote in message
...
I didn't intend to use these long formulas in my vb
script. But on this one occassion, it is absolutely
necessary. I have live spreadsheet ranges that are
calculating what line the active cell is and I have to
capture that number at the appropriate time in order to do
the right string for this one line. So, at the point I
have this formula is the precise moment in the script
where I need to pass the value of this formula

The way it is here it beeps at me at me with the message
of a compile error. And I've worked and I've listened to
how Bob and Tom said it works, but I still don't get it,
at least not for this long a formula anyway. So, please
just copy, paste, and edit as necessary to show me the
proper syntax in this case.

ActiveCell.Formula = "=IF(FIXED(INDEX("&Range("Summary")
&","&Range("ROWSUM"&"+1,2),0,TRUE)" _
=INDEX("&Range("Summary")&","&Range("ROWSUM")
&"+1,1),="SE~"&FIXED(Range("LINES1")&",0,TRUE)"&"~ 0001, _
SE~"&"FIXED("Range("LINES1")-Range("LINES2")&",0)~0001)"

Otherwise, I will continue to be extremely frustrated
trying to learn it by trial and error.

Thanks,


Bruce



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Please debug this one formula in VB

Bruce,

Much too hard to try and get into your mind and work out what you are trying
to do.

Suggestion:

Type out the formula that you want to see on the worksheet, with correct
values. Tell us what ranges Summary, ROWSUM, LINES1 and LINES2 cover, and
the values therein, and which you want cell references and which values, and
it will be easy then.

--

HTH

Bob Phillips

"Bruce Roberson" wrote in message
...
I didn't intend to use these long formulas in my vb
script. But on this one occassion, it is absolutely
necessary. I have live spreadsheet ranges that are
calculating what line the active cell is and I have to
capture that number at the appropriate time in order to do
the right string for this one line. So, at the point I
have this formula is the precise moment in the script
where I need to pass the value of this formula

The way it is here it beeps at me at me with the message
of a compile error. And I've worked and I've listened to
how Bob and Tom said it works, but I still don't get it,
at least not for this long a formula anyway. So, please
just copy, paste, and edit as necessary to show me the
proper syntax in this case.

ActiveCell.Formula = "=IF(FIXED(INDEX("&Range("Summary")
&","&Range("ROWSUM"&"+1,2),0,TRUE)" _
=INDEX("&Range("Summary")&","&Range("ROWSUM")
&"+1,1),="SE~"&FIXED(Range("LINES1")&",0,TRUE)"&"~ 0001, _
SE~"&"FIXED("Range("LINES1")-Range("LINES2")&",0)~0001)"

Otherwise, I will continue to be extremely frustrated
trying to learn it by trial and error.

Thanks,


Bruce



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
How to debug formula problems Stefan Froehlich Excel Worksheet Functions 1 October 24th 08 05:49 PM
VB Debug Reset SJW_OST Excel Discussion (Misc queries) 1 February 7th 08 03:07 AM
DeBug Ollie Excel Discussion (Misc queries) 4 April 28th 06 03:17 PM
help with debug Rusty New Users to Excel 3 February 2nd 05 03:16 AM
debug errors.... Bruccce Excel Programming 0 July 18th 03 06:04 PM


All times are GMT +1. The time now is 04:35 AM.

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"