Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I´m trying to programm with VBA in Excel.
I have in a sheet the code farmers. I also have the sheet Trees, the sheet WaterQuality , the sheet WaterQuantity and the sheet Biodiversity, etc. I need to copy the code Farmers into those sheets. Each farmer will be associated with every range in the code trees, code waterQuality, etc. I want to avoid copying the Farmer code every time I need it Does somebody may showed me how to copy the code farmer in the codes I describe as example? Many thanks in advance CodFarmers Range("A1").Select Range("A2").FormulaR1C1 = "201" Range("A2").Select Range("A3").FormulaR1C1 = "202" Range("A3").Select Range("A4").FormulaR1C1 = "203" Range("A4").Select Range("A5").FormulaR1C1 = "204" Range("A5").Select Range("A6").FormulaR1C1 = "205" Range("A6").Select Range("A7").FormulaR1C1 = "206" Range("A7").Select End Sub Code Trees Range("C2").Select ActiveCell.FormulaR1C1 = "1" Range("D2").Select ActiveCell.FormulaR1C1 = "WindBreakers" Range("C3").Select ActiveCell.FormulaR1C1 = "2" Range("D3").Select ActiveCell.FormulaR1C1 = "Forest Incentive" Range("C4").Select ActiveCell.FormulaR1C1 = "3" Range("D4").Select ActiveCell.FormulaR1C1 = "Spring protection" Range("C5").Select ActiveCell.FormulaR1C1 = "4" Range("D5").Select ActiveCell.FormulaR1C1 = "Shading" Range("C6").Select ActiveCell.FormulaR1C1 = "5" Range("D6").Select ActiveCell.FormulaR1C1 = "Conservation" Range("C7").Select ActiveCell.FormulaR1C1 = "6" Range("D7").Select ActiveCell.FormulaR1C1 = "Landscape" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I need example code. Need a large Math (times X) table. | Excel Programming | |||
code loops 1024 times not what i ask | Excel Programming | |||
How do I count how many times a code appears in a column? | Excel Worksheet Functions | |||
Code works but I have to run it 4 times | Excel Programming | |||
Over-Eager code is pasting 3 times | Excel Programming |