• 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.

Convert values from one unit to another using VBA

siddharthsopori

New Member
Hello Gurus ,

PFA the sample file.
We need to convert the values highlighted in YELLOW to the Sales Unit of measurement from Base unit of measurement using VBA
IF sales UoM = Base UoM , do nothing to the values of the corresponding row
IF Sales UoM = GAL and Base UoM = L , values = values*0.264172 (all the values of the corresponding row)
IF Sales UoM = LBS and Base UoM = KG , values=value*2.20462(all the values of the corresponding row)
*The number of rows and columns are not fixed so definite values of rows and columns cannot be used Eg. From F2:S2 cannot be used.

Regards
Sid
 

Attachments

  • EXAMPLE.xlsx
    11.9 KB · Views: 2
Hi:

Is this what you are looking for I have not used any macros.

Thanks
 

Attachments

  • EXAMPLE.xlsx
    12.8 KB · Views: 9
Hi:

Is this what you are looking for I have not used any macros.

Thanks
Hi ,
Thanks for your reply .
Issues in the solution you provided :
1) We need the conversion to be done for individual entries of the row , not the row total.
2)All the quantities are in Base UoM , so , if Sales UoM = Base UoM , then no conversion is needed .

Regards
Sid
 
Hi:

I am afraid I understood you correctly, do you mean to say that, you want to replace the vales in column F to S based on the condition.

Thanks
 
Back
Top