Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default VBA's Q? Printing None-Zero Valye ONLY

Hi everyone,

I have this VBA piece of code and want Activity value to be written
only if it is none-zero:

Do While varVect.PosValid
If varVect.Variable 0 Then
line = line + 1
CRngSolution(line, 1).Value = subMr.Value
CRngSolution(line, 2).Value = subAcf.Value
CRngSolution(line, 3).Value = subLo.Value
CRngSolution(line, 4).Value = varVect.Variable.Activity
End If
varVect.MoveNextPos
Loop

But it is still writing zeros and non-zeros! Anything wrong?

Thanks,
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default VBA's Q? Printing None-Zero Valye ONLY

On 17/10/2011 20:31, Mike wrote:
Hi everyone,

I have this VBA piece of code and want Activity value to be written
only if it is none-zero:

Do While varVect.PosValid
If varVect.Variable 0 Then
line = line + 1
CRngSolution(line, 1).Value = subMr.Value
CRngSolution(line, 2).Value = subAcf.Value
CRngSolution(line, 3).Value = subLo.Value
CRngSolution(line, 4).Value = varVect.Variable.Activity
End If
varVect.MoveNextPos
Loop

But it is still writing zeros and non-zeros! Anything wrong?

Thanks,
Mike


Try

If varVect.Variable.Activity 0 Then

or look at what variable type varVect.Variable.Activity actually returns
for the above comparision. Maybe it's never exactly 0.

--
Adrian C

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
Where is VBA's BeforeSheetChange event? Bland Excel Programming 5 February 3rd 10 10:47 PM
PUTTING VBA'S TOGETHER confused deejay Excel Worksheet Functions 5 September 1st 08 03:56 AM
Conflicting VBA's pdberger Excel Programming 2 March 3rd 08 08:52 PM
XML equivalent of VBA's XLdown Nick Flyger Excel Programming 1 December 7th 06 01:27 AM
VBA's Future xnman Excel Programming 3 October 20th 03 07:04 PM


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