Simplifying Multiple Cell Fill In

VeeBeeIntern

New Member
Joined
Jun 19, 2014
Messages
6
I have the following code to convert cells from metric units to standard and I know there has to be a way that takes less time. The cells have to reference cells from a different sheet; they can't use the data originally in the cells because the original data needs to be used later.
If OutUnits = "Metric" Then
ActiveSheet.Range("C36:B65").Replace What:="[lb]", Replacement:="[N]"
Range("I40").Value = Sheets("DATA").Range("G22") * 4.44822162
Range("K40").Value = Sheets("DATA").Range("G23") * 4.44822162
Range("M40").Value = Sheets("DATA").Range("G24") * 4.44822162
Range("I41").Value = Sheets("DATA").Range("G25") * 4.44822162
Range("K41").Value = Sheets("DATA").Range("G26") * 4.44822162
Range("M41").Value = Sheets("DATA").Range("G27") * 4.44822162
Range("I42").Value = Sheets("DATA").Range("G28") * 4.44822162
Range("K42").Value = Sheets("DATA").Range("G29") * 4.44822162
Range("M42").Value = Sheets("DATA").Range("G30") * 4.44822162
Range("F48").Value = Sheets("DATA").Range("L120") * 4.44822162
Range("G48").Value = Sheets("DATA").Range("M120") * 4.44822162
Range("H48").Value = Sheets("DATA").Range("N120") * 4.44822162
Range("I48").Value = Sheets("DATA").Range("O120") * 4.44822162
Range("F49").Value = Sheets("DATA").Range("L121") * 4.44822162
Range("G49").Value = Sheets("DATA").Range("M121") * 4.44822162
Range("H49").Value = Sheets("DATA").Range("N121") * 4.44822162
Range("I49").Value = Sheets("DATA").Range("O121") * 4.44822162
Range("F50").Value = Sheets("DATA").Range("L122") * 4.44822162
Range("G50").Value = Sheets("DATA").Range("M122") * 4.44822162
Range("H50").Value = Sheets("DATA").Range("N122") * 4.44822162
Range("I50").Value = Sheets("DATA").Range("O122") * 4.44822162
Range("F50").Value = Sheets("DATA").Range("L122") * 4.44822162
Range("G50").Value = Sheets("DATA").Range("M122") * 4.44822162
Range("H50").Value = Sheets("DATA").Range("N122") * 4.44822162
Range("I50").Value = Sheets("DATA").Range("O122") * 4.44822162
Range("F52").Value = Sheets("DATA").Range("L124") * 4.44822162
Range("G52").Value = Sheets("DATA").Range("M124") * 4.44822162
Range("H52").Value = Sheets("DATA").Range("N124") * 4.44822162
Range("I52").Value = Sheets("DATA").Range("O124") * 4.44822162
Range("F53").Value = Sheets("DATA").Range("L125") * 4.44822162
Range("H53").Value = Sheets("DATA").Range("N125") * 4.44822162
Range("F59").Value = Sheets("DATA").Range("L59") * 4.44822162
Range("G59").Value = Sheets("DATA").Range("M59") * 4.44822162
Range("H59").Value = Sheets("DATA").Range("N59") * 4.44822162
Range("I59").Value = Sheets("DATA").Range("O59") * 4.44822162
Range("F60").Value = Sheets("DATA").Range("L60") * 4.44822162
Range("G60").Value = Sheets("DATA").Range("M60") * 4.44822162
Range("H60").Value = Sheets("DATA").Range("N60") * 4.44822162
Range("I60").Value = Sheets("DATA").Range("O60") * 4.44822162
Range("F61").Value = Sheets("DATA").Range("L61") * 4.44822162
Range("G61").Value = Sheets("DATA").Range("M61") * 4.44822162
Range("H61").Value = Sheets("DATA").Range("N61") * 4.44822162
Range("I61").Value = Sheets("DATA").Range("O61") * 4.44822162
Range("F63").Value = Sheets("DATA").Range("L63") * 4.44822162
Range("G63").Value = Sheets("DATA").Range("M63") * 4.44822162
Range("H63").Value = Sheets("DATA").Range("N63") * 4.44822162
Range("I63").Value = Sheets("DATA").Range("O63") * 4.44822162
Range("F64").Value = Sheets("DATA").Range("L64") * 4.44822162
Range("H64").Value = Sheets("DATA").Range("N64") * 4.44822162
Range("J48").Value = Sheets("DATA").Range("L35") * 4.44822162
Range("K48").Value = Sheets("DATA").Range("M35") * 4.44822162
Range("L48").Value = Sheets("DATA").Range("N35") * 4.44822162
Range("M48").Value = Sheets("DATA").Range("O35") * 4.44822162
Range("J49").Value = Sheets("DATA").Range("L36") * 4.44822162
Range("K49").Value = Sheets("DATA").Range("M36") * 4.44822162
Range("L49").Value = Sheets("DATA").Range("N36") * 4.44822162
Range("M49").Value = Sheets("DATA").Range("O36") * 4.44822162
Range("J50").Value = Sheets("DATA").Range("L37") * 4.44822162
Range("K50").Value = Sheets("DATA").Range("M37") * 4.44822162
Range("L50").Value = Sheets("DATA").Range("N37") * 4.44822162
Range("M50").Value = Sheets("DATA").Range("O37") * 4.44822162
Range("J52").Value = Sheets("DATA").Range("L39") * 4.44822162
Range("K52").Value = Sheets("DATA").Range("M39") * 4.44822162
Range("L52").Value = Sheets("DATA").Range("N39") * 4.44822162
Range("M52").Value = Sheets("DATA").Range("O39") * 4.44822162
Range("J53").Value = Sheets("DATA").Range("L40") * 4.44822162
Range("L53").Value = Sheets("DATA").Range("N40") * 4.44822162
Range("J59").Value = Sheets("DATA").Range("L83") * 4.44822162
Range("K59").Value = Sheets("DATA").Range("M83") * 4.44822162
Range("L59").Value = Sheets("DATA").Range("N83") * 4.44822162
Range("M59").Value = Sheets("DATA").Range("O83") * 4.44822162
Range("J60").Value = Sheets("DATA").Range("L84") * 4.44822162
Range("K60").Value = Sheets("DATA").Range("M84") * 4.44822162
Range("L60").Value = Sheets("DATA").Range("N84") * 4.44822162
Range("M60").Value = Sheets("DATA").Range("O84") * 4.44822162
Range("J61").Value = Sheets("DATA").Range("L85") * 4.44822162
Range("K61").Value = Sheets("DATA").Range("M85") * 4.44822162
Range("L61").Value = Sheets("DATA").Range("N85") * 4.44822162
Range("M61").Value = Sheets("DATA").Range("O85") * 4.44822162
Range("J63").Value = Sheets("DATA").Range("L87") * 4.44822162
Range("K63").Value = Sheets("DATA").Range("M87") * 4.44822162
Range("L63").Value = Sheets("DATA").Range("N87") * 4.44822162
Range("M63").Value = Sheets("DATA").Range("O87") * 4.44822162
Range("J64").Value = Sheets("DATA").Range("L88") * 4.44822162
Range("L64").Value = Sheets("DATA").Range("N88") * 4.44822162


ElseIf OutUnits = "Standard" Then
ActiveSheet.Range("B36:B65").Replace What:="[N]", Replacement:="[lb]"
Range("I40").Value = Sheets("DATA").Range("G22")
Range("K40").Value = Sheets("DATA").Range("G23")
Range("M40").Value = Sheets("DATA").Range("G24")
Range("I41").Value = Sheets("DATA").Range("G25")
Range("K41").Value = Sheets("DATA").Range("G26")
Range("M41").Value = Sheets("DATA").Range("G27")
Range("I42").Value = Sheets("DATA").Range("G28")
Range("K42").Value = Sheets("DATA").Range("G29")
Range("M42").Value = Sheets("DATA").Range("G30")
Range("F48").Value = Sheets("DATA").Range("L120")
Range("G48").Value = Sheets("DATA").Range("M120")
Range("H48").Value = Sheets("DATA").Range("N120")
Range("I48").Value = Sheets("DATA").Range("O120")
Range("F49").Value = Sheets("DATA").Range("L121")
Range("G49").Value = Sheets("DATA").Range("M121")
Range("H49").Value = Sheets("DATA").Range("N121")
Range("I49").Value = Sheets("DATA").Range("O121")
Range("F50").Value = Sheets("DATA").Range("L122")
Range("G50").Value = Sheets("DATA").Range("M122")
Range("H50").Value = Sheets("DATA").Range("N122")
Range("I50").Value = Sheets("DATA").Range("O122")
Range("F52").Value = Sheets("DATA").Range("L124")
Range("G52").Value = Sheets("DATA").Range("M124")
Range("H52").Value = Sheets("DATA").Range("N124")
Range("I52").Value = Sheets("DATA").Range("O124")
Range("F53").Value = Sheets("DATA").Range("L125")
Range("H53").Value = Sheets("DATA").Range("N125")
Range("F59").Value = Sheets("DATA").Range("L59")
Range("G59").Value = Sheets("DATA").Range("M59")
Range("H59").Value = Sheets("DATA").Range("N59")
Range("I59").Value = Sheets("DATA").Range("O59")
Range("F60").Value = Sheets("DATA").Range("L60")
Range("G60").Value = Sheets("DATA").Range("M60")
Range("H60").Value = Sheets("DATA").Range("N60")
Range("I60").Value = Sheets("DATA").Range("O60")
Range("F61").Value = Sheets("DATA").Range("L61")
Range("G61").Value = Sheets("DATA").Range("M61")
Range("H61").Value = Sheets("DATA").Range("N61")
Range("I61").Value = Sheets("DATA").Range("O61")
Range("F63").Value = Sheets("DATA").Range("L63")
Range("G63").Value = Sheets("DATA").Range("M63")
Range("H63").Value = Sheets("DATA").Range("N63")
Range("I63").Value = Sheets("DATA").Range("O63")
Range("F64").Value = Sheets("DATA").Range("L64")
Range("H64").Value = Sheets("DATA").Range("N64")
Range("J48").Value = Sheets("DATA").Range("L35")
Range("K48").Value = Sheets("DATA").Range("M35")
Range("L48").Value = Sheets("DATA").Range("N35")
Range("M48").Value = Sheets("DATA").Range("O35")
Range("J49").Value = Sheets("DATA").Range("L36")
Range("K49").Value = Sheets("DATA").Range("M36")
Range("L49").Value = Sheets("DATA").Range("N36")
Range("M49").Value = Sheets("DATA").Range("O36")
Range("J50").Value = Sheets("DATA").Range("L37")
Range("K50").Value = Sheets("DATA").Range("M37")
Range("L50").Value = Sheets("DATA").Range("N37")
Range("M50").Value = Sheets("DATA").Range("O37")
Range("J52").Value = Sheets("DATA").Range("L39")
Range("K52").Value = Sheets("DATA").Range("M39")
Range("L52").Value = Sheets("DATA").Range("N39")
Range("M52").Value = Sheets("DATA").Range("O39")
Range("J53").Value = Sheets("DATA").Range("L40")
Range("L53").Value = Sheets("DATA").Range("N40")
Range("J59").Value = Sheets("DATA").Range("L83")
Range("K59").Value = Sheets("DATA").Range("M83")
Range("L59").Value = Sheets("DATA").Range("N83")
Range("M59").Value = Sheets("DATA").Range("O83")
Range("J60").Value = Sheets("DATA").Range("L84")
Range("K60").Value = Sheets("DATA").Range("M84")
Range("L60").Value = Sheets("DATA").Range("N84")
Range("M60").Value = Sheets("DATA").Range("O84")
Range("J61").Value = Sheets("DATA").Range("L85")
Range("K61").Value = Sheets("DATA").Range("M85")
Range("L61").Value = Sheets("DATA").Range("N85")
Range("M61").Value = Sheets("DATA").Range("O85")
Range("J63").Value = Sheets("DATA").Range("L87")
Range("K63").Value = Sheets("DATA").Range("M87")
Range("L63").Value = Sheets("DATA").Range("N87")
Range("M63").Value = Sheets("DATA").Range("O87")
Range("J64").Value = Sheets("DATA").Range("L88")
Range("L64").Value = Sheets("DATA").Range("N88")
End If
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Watch MrExcel Video

Forum statistics

Threads
1,130,169
Messages
5,640,548
Members
417,151
Latest member
ChickenTenderer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top