May 29 2019 12:32 PM
Hello,
i Recorded the Macro below:
Sub Conversion()
'
' Conversion Macro
'
'
Range("Y1").Select
Selection.Copy
Range("B11:AE11,B13:AE13,B15:AE15,B17:AE17,B19:AE19,B21:AE21,B23:AE23,B25:AE25,B25:AE25,B27:AE27,B29:AE29,B31:AE31,B33:AE33,B35:AE35,B37:AE37,B39:AE39,B41:AE41,B43:AE43,B45:AE45,B47:AE47,B49:AE49,B51:AE51,B53:AE53,B55:AE55,B57:AE57,B59:AE59,B61:AE61,B63:AE63").Select
' Range("B11:AE11,B13:AE13,B15:AE15,B17:AE17,B19:AE19,B21:AE21,B23:AE23,B25:AE25,B25:AE25,B27:AE27,B29:AE29,B31:AE31,B33:AE33,B35:AE35,B37:AE37,B39:AE39,B41:AE41,B43:AE43,B45:AE45,B47:AE47,B49:AE49,B51:AE51,B53:AE53,B55:AE55,B57:AE57,B59:AE59,B61:AE61,B63:AE63,B65:AE65,B67:AE67,B69:AE69,B71:AE71,B73:AE73,B75:AE75,B77:AE77,B79:AE79,B81:AE81,B83:AE83,B85:AE85,B87:AE87,B89:AE89,B91:AE91,B93:AE93,B95:AE95,B97:AE97,B99:AE99,B101:AE101,B103:AE103,B105:AE105,B107:AE107,B109:AE109,B111:AE111").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "0"
Range("Y1").Select
Selection.Copy
Range("B65:AE65,B67:AE67,B69:AE69,B71:AE71,B73:AE73,B75:AE75,B77:AE77,B79:AE79,B81:AE81,B83:AE83,B85:AE85,B87:AE87,B89:AE89,B91:AE91,B93:AE93,B95:AE95,B97:AE97,B99:AE99,B101:AE101,B103:AE103,B105:AE105,B107:AE107,B109:AE109,B111:AE111").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "0"
End Sub
I am multiplying the value in Y1 (single value) with the range listed above(Just the black values in
18-20 LRFD) sheet. When i run the macro, it changes the format in the range. How can i fix it so it won't change the format?
Thanks,
Sam
May 29 2019 01:17 PM
Hi Sam,
Try to remove the lines that say:
Selection.NumberFormat = "0"
There are two lines of them in the macro.
Hope that helps
May 29 2019 01:30 PM
Thank you Haytham!
This line is to truncate the numbers. My issue is i don't want to change the color of the cell.
In the top picture below is after multiplication and removing the line you just told me about. The second picture is what it originally looked like. i Just want to multiply the numbers only without modifying the color of the cell.
May 29 2019 01:54 PM
Solution
If so, replace this argument:
Paste:=xlPasteAll
With this:
Paste:=xlValue
There is two of this in the code.
I hope that helps
May 29 2019 02:04 PM
Yes this is the solution.Thank you Haytham!
May 29 2019 01:54 PM
Solution
If so, replace this argument:
Paste:=xlPasteAll
With this:
Paste:=xlValue
There is two of this in the code.
I hope that helps