View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul Black Paul Black is offline
external usenet poster
 
Posts: 394
Default Using DEC2BIN(range,6) in VBA Code

Thanks for the reply Tom,

Is there a way so I don't need to actually input the 0 to 63 values in
the spreadsheet please. What I mean by that is get the program to
calculate the 0 to 63 and use them instead of the spreadsheet figures
because I don't actually need the 0 to 63 figures at all, they are
only there to work out the DEC2BIN(range,6) values.

Thanks in Advance.
All the Best.
Paul

On Sep 26, 12:38 pm, Tom Ogilvy
wrote:
For i = 2 to 65
Cells(i,"C").Value = Application.Run("ATPVBAEN.XLA!DEC2BIN",Cells(i,"B" ))
Next
--
Regards,
Tom Ogilvy



"Paul Black" wrote:
Hi everyone,


At the moment I input the vales 0 to 63 in cells "B2:B65".
I input the Formula =DEC2BIN(B2,6) into cell "C2" and copy it down to
cell "C65".
The =DEC2BIN(range,6) is an engineering function that converts
"Decimal" to "Binary". For anybody wanting to use this the Analysis
ToolPak needs to be installed (which I have).


I have the code :-


Range("A1").Select


For I = 1 To 64
ActiveCell.Offset(I, 2).Value = nSum(I)
Next I


The output starts in cell "D2" and continues down to cell "D65" and
works great.
Is there anyway that I can use the DEC2BIN(range,6) so the code
calculates it and outputs the answer, preferably not getting it to
output the formula itself into the worksheet. I would ideally like the
figures produced to be output to cells "C2:C65" please.


Thanks in Advance.
All the Best.
Paul- Hide quoted text -


- Show quoted text -