LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Insert Additional Numeric Value in a cell using VBA

Hi Nigel,

Thanks again for further input.

Why cannot you use two cells?

Due to the existing layout of the Worksheet and manageable printouts it would
be desirable to use one cell.

The only possibility might be to use a value uses the integer and fractional parts as separate values.
e.g.: 100.124 becomes 100 and 124 respectively.


Interested in above possible solution using integer and fractional parts.

The second chart, CHART2, where I wish the VBA numeric values to be placed
has the following Excel Worksheet Formula in each cell. This Formula sums the
totals of a specific Numeric Label appearing in a single column in CHART1
(every third Row is blank):

=SUMPRODUCT(--(MOD(ROW(F$117:F$191)-ROW(F$117)+0,3)=0),--(F$117:F$191=$C269))
+SUMPRODUCT(--(MOD(ROW(F$194:F$264)-ROW(F$194)+0,3)=0),--(F$194:F$264=$C269))

There is a Row of Numeric Labels, then a Row of Numeric Values, then a Blank
Row. This Layout/ pattern is repeated down many Rows. The Rows of Numeric
Labels and Values work in pairs and are sorted as paired Rows, hence the
third Blank Row (after every two Rows) to denote a new paired Row of data.

The cell location of the Values to be added to CHART2 are based on the co-
ordinates (Row and Column Number) of the Values located on CHART1. These co-
ordinates are provided by the MATCH and INDEX Functions.

Could a VBA process and Formula be created to automate the positioning of
numeric values 1-100 on CHART2 by using Formulas similar to those below to
locate the relevant Row and Column Numbers relating to the values 1-100 on
CHART1.

Two Charts involved -
CHART1:
Named Range "Range3" Horizontal Numeric Labels (one Row) not in any order.
Named Range "Range2" First Veritcal Numeric Labels (one Column) in Ascending
order.
Named Range "Range1" Second Vertical Numeric Labels (one Column) not in any
order.

Locate Row Number:
=INDEX(Range1,MATCH(1,Range2,0),0)

Locate Column Number:
=MATCH(INDEX(Range1,MATCH(1,Range2,0),0),Range3,0)

CHART2:
Use the above co-ordinates eg: Row 11, Column 9 to find relevant cell.
This cell should now be populated via VBA with the numeric value 1 - NOT,
overwriting existing values created by Excel Worksheet Formulas.

in VBA you could use something like......(assumes value is in cell A1)


Sub Extract()
Dim val1 As Integer, val2 As Integer
val1 = Int(Range("A1"))
val2 = (Range("A1") - val1) * 1000


MsgBox "Value 1 = " & val1 & vbCrLf & "Value 2 = " & val2
End Sub


The above VBA code does not provide required Result. If possible, would
appreciate further assistance.

Cheers,
Sam

Nigel wrote:
The only possibility might be to use a value uses the integer and fractional
parts as separate values.

e.g.: 100.124 becomes 100 and 124 respectively. Using Integer to get the
first value and then subtract that from the original value and multiply it
up to the scale required. But you are going to be limited in the range of
values available. Why cannot you use two cells?

in VBA you could use something like......(assumes value is in cell A1)

Sub Extract()
Dim val1 As Integer, val2 As Integer
val1 = Int(Range("A1"))
val2 = (Range("A1") - val1) * 1000

MsgBox "Value 1 = " & val1 & vbCrLf & "Value 2 = " & val2
End Sub

Hi Nigel,

[quoted text clipped - 16 lines]
Best Wishes
Sam


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1
 
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 do I add NOT insert additional worksheet to existing workbook. Phyllis Excel Worksheet Functions 6 November 1st 09 04:11 PM
TO DELETE ONLY NUMERIC VALUES IN A CHARACTER AND NUMERIC CELL IN ramesh k. goyal - abohar[_2_] Excel Discussion (Misc queries) 1 October 28th 09 06:50 AM
formula for 'If a cell is empty then insert numeric Zero' P Ryan Nutribio Excel Worksheet Functions 4 June 18th 09 02:07 AM
How do I copy numeric section of cell from alpha-numeric cell ACCAguy Excel Worksheet Functions 8 September 8th 08 12:46 PM
only extract numeric value from alpha numeric cell Fam via OfficeKB.com Excel Discussion (Misc queries) 5 April 26th 06 06:49 PM


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