How to run a formula on a cell I want to copy in VBA

  • Hey All,

    I have the following code below as well as the attached excel file. I would appreciate any help on the following problems I have:

    1) How would I copy over the rows of data from market data to template data and ensure the formatting is kept the same? (compact rows where everything fits and is adjusted)

    2) If market data and template data were in two separate workbooks, how would I change the code to open up market data workbook copy over the rows of data and then close the market data workbook?

    3) How can I copy the rows but run a formula on cells T4 to Y4 in market data so the the currency is converted to EUR (divide all these cells by FX value in Column E) and then copied over to template data? Unfortunately, I can't run this conversion first as the data is going to be used in this format and so the conversion will have to be done throughout the macro process.

    Any help is massively appreciated, thank you in advance!

  • There would be a couple of issues if you simply copied the rows from market data to template data. First, there are more columns of data in market data than in template data and second, there are some column headers in market data that do not exist in template data. Please clarify in detail. It would be helpful if you could manually create another sheet that shows your desired result including how you want the cells formatted and then attach an updated file.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!