LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Code Improvements

I have the following code, I know there has to be some way to improve on it.
I would greatly appreciate it if someone would give me some guidance on it.
Thanks in advance and here is what code I have.

Sub test()
Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range, rng4 As Range
Dim rng5 As Range, rng6 As Range, rng7 As Range, rng8 As Range
Dim rng9 As Range, rng10 As Range, rng11 As Range, rng12 As Range
Dim rng13 As Range, rng14 As Range
Dim wb1 As Workbook

Set wb1 = Workbooks.Open("c:\Inventory\xlWorkFile\xlMasterFi le")


Set rng1 = wb1.Worksheets("txtMaster").Range("C1:C1500")
Set rng2 = wb1.Worksheets("txtMaster").Range("F1:F1500")
Set rng3 = wb1.Worksheets("txtMaster").Range("G1:G1500")
Set rng4 = wb1.Worksheets("txtMaster").Range("I1:I1500")
Set rng5 = wb1.Worksheets("txtMaster").Range("J1:J1500")
Set rng6 = wb1.Worksheets("txtMaster").Range("K1:K1500")
Set rng7 = wb1.Worksheets("txtMaster").Range("M1:M1500")

Set rng8 = Workbooks("Book2").Sheets("Sheet1").Range("B3")
Set rng9 = Workbooks("Book2").Sheets("Sheet1").Range("C3")
Set rng10 = Workbooks("Book2").Sheets("Sheet1").Range("D3")
Set rng11 = Workbooks("Book2").Sheets("Sheet1").Range("E3")
Set rng12 = Workbooks("Book2").Sheets("Sheet1").Range("F3")
Set rng13 = Workbooks("Book2").Sheets("Sheet1").Range("G3")
Set rng14 = Workbooks("Book2").Sheets("Sheet1").Range("H3")

rng1.Copy rng8
rng2.Copy rng9
rng3.Copy rng10
rng4.Copy rng11
rng5.Copy rng12
rng6.Copy rng13
rng7.Copy rng14
End Sub

--
Larry E. Brueshaber
 
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
Counting Consecutive Improvements SteveC Excel Discussion (Misc queries) 0 June 13th 06 01:35 AM
Performance Improvements while using RTD [email protected] Excel Programming 12 December 19th 05 12:10 PM
Message Box Improvements Phil Hageman[_4_] Excel Programming 3 June 17th 05 05:34 PM
ListView to Excel Code (but needs SPEED improvements) SVD Excel Programming 1 February 2nd 04 10:54 AM
anyone have any improvements for my Weeks Function? reesmacleod[_6_] Excel Programming 8 December 5th 03 11:30 PM


All times are GMT +1. The time now is 05:17 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"