Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Using a code n times

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need example code. Need a large Math (times X) table. Hrundi V. Bakshi Excel Programming 8 December 11th 06 03:06 PM
code loops 1024 times not what i ask Rob Hargreaves[_2_] Excel Programming 3 August 7th 05 11:36 AM
How do I count how many times a code appears in a column? Leo Excel Worksheet Functions 3 June 2nd 05 08:50 PM
Code works but I have to run it 4 times Todd Huttenstine Excel Programming 4 May 10th 04 08:47 PM
Over-Eager code is pasting 3 times Stuart[_5_] Excel Programming 3 September 10th 03 07:30 PM


All times are GMT +1. The time now is 10:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"