Converting Excel Formula to Macro

  • Thread starter Thread starter mjm917
  • Start date Start date
M

mjm917

I hope this makes sense.

I am trying to reduce some manual intervention when creating an XM
file from Excel. Unfortunately I cannot just save the file in XM
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 look
at values in other columns in the matching row concatenates the
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>
<name>Base Price</name>
</itemPriceTypeRef>
<itemPrice>22.50</itemPrice>
</itemPriceLine>
<itemPriceLine>
<itemPriceTypeRef>
<name>Online Price</name>
</itemPriceTypeRef>
<itemPrice>23.50</itemPrice>
</itemPriceLine>

Any help wold be appreciate
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top