Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default transfer data between worksheets

This will do it

Private Sub Command1_Click()

Dim Daily As Worksheet
Dim Data As Worksheet
Dim i%

Set Daily = Worksheets("Daily")
Set Data = Worksheets("Data")

For i = 1 To 26

Daily.Range("A12").Offset((i - 1) * 20, 0).Value =
Data.Range("A5").Offset(i - 1, 0).Value
'Daily.Range("A32").Value = Data.Range("A6").Value
'all the way down to'
'Daily.Range("A562").Value = Data.Range("A30").Value

Next i

End Sub

Alok Joshi


"Qaspec" wrote:

right now i'm using the following code to transfer data. instead of
reapeating the line 26 times is there a way to create this code in a smaller
statement if the data row always increases by 20 and the daily row by 1.

Private Sub Command1_Click()

Dim Daily As Worksheet
Dim Data As Worksheet


Set Daily = Worksheets("Daily")
Set Data = Worksheets("Data")

Daily.Range("A12").Value = Data.Range("A5").Value
Daily.Range("A32").Value = Data.Range("A6").Value
'all the way down to'
Daily. Range("A562").Value=Data.Range("A30").Value



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
Transfer between accounts (worksheets) LuckyCharm Excel Discussion (Misc queries) 0 January 3rd 09 08:55 PM
Drop down lists to transfer data between worksheets patrickj Excel Worksheet Functions 2 July 27th 08 10:37 PM
Transfer data from multiple worksheets jimbob Excel Discussion (Misc queries) 4 January 29th 06 02:38 AM
Transfer data between worksheets Rob Excel Programming 6 January 12th 05 03:31 PM
Transfer data between worksheets Rob Excel Programming 0 January 12th 05 01:57 PM


All times are GMT +1. The time now is 08:02 AM.

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"