• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA code for copy & paste the data in the format

All,
I have a data on one sheet and required to copy the data in the desired format in another sheet.
I wrote the code for date and rate to copy but it's not working properly.
Please do the needful. I am learning VBA from 2 months.
 

Attachments

  • conversion rate.xlsm
    128.7 KB · Views: 4
Hi, vmohan1978!

Why VBA? You can do it with formulas. Give a look at the uploaded file.

A2: =DESREF(wksData!$A$2;ENTERO((FILA()+2)/4);0) -----> in English: =OFFSET(wksData!$A$2,INT((ROW()+2)/4),0)

B2: =DESREF(wksData!$A$2;0;RESIDUO(FILA()+2;4)+1) -----> in English: =OFFSET(wksData!$A$2,0,MOD(ROW()+2,4)+1)

C2: =DESREF(wksData!$A$2;ENTERO((FILA()+2)/4);RESIDUO(FILA()+2;4)+1) -----> in English: =OFFSET(wksData!$A$2,INT((ROW()+2)/4),MOD(ROW()+2,4)+1)

Copy down as required.

Regards!
 

Attachments

  • conversion rate.xlsm
    139.3 KB · Views: 4
Hi ,
Sorry for the late reply. Thanks it worked perfectly. I will be updating the data every week, so VBA will be very useful automatically it updates inlieu of offset formula.
 
Back
Top