View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Kilmer Bob Kilmer is offline
external usenet poster
 
Posts: 280
Default Converting Excel Formula to Macro

What tasks are you trying to eliminate and how would describe to someone
unfamiliar with your process how to do them? Do you want to automate the
copying? What is the value of n? How is it determined? How do you decide
what column and row to copy the initial formula into?


"mjm917" wrote in message
...

I hope this makes sense.

I am trying to reduce some manual intervention when creating an XML
file from Excel. Unfortunately I cannot just save the file in XML
format because many of the values are child values.

Current I copy a formula to a range of cells in a particular column,
say column L, starting at row 5 and going to row n. The formula looks
at values in other columns in the matching row concatenates them
together along with some hardcoded XML tags to create an XML string.

Example Data

Cell R5 = "Base Price"
Cell S5 = "" (Empty String)
Cell T5 = "22.50"
Cell U5 = "Online Price"
Cell V5 = "" (Empty String)
Cell W5 = "23.50"

I copy a formula to Cell L5 and the resulting value for L5 is:

<itemPriceLine
<itemPriceTypeRef
<nameBase Price</name
</itemPriceTypeRef
<itemPrice22.50</itemPrice
</itemPriceLine
<itemPriceLine
<itemPriceTypeRef
<nameOnline Price</name
</itemPriceTypeRef
<itemPrice23.50</itemPrice
</itemPriceLine

Any help wold be appreciated


--
mjm917
------------------------------------------------------------------------
mjm917's Profile:

http://www.excelforum.com/member.php...o&userid=14711
View this thread: http://www.excelforum.com/showthread...hreadid=263354