Prev Previous Post   Next Post Next
  #1   Report Post  
Pete
 
Posts: n/a
Default Tidy Up

Can anyone tidy up the Sub below for me please, all it does is takes
one value from formula in "Sheet1", and stores it as a value in
"Usage". As you can see the Weekday command is used to decide which
column is used to store the values.

This Sub works, but my lack of VBA experience makes it very untidy.

Thanks

Pete

Private Sub UsageSheet()
Dim DailyPallets(17) As Long, DailyRejectBags(17) As Long, Ctr
Ctr = 0

For Ctr = 1 To 17
DailyPallets(Ctr) = Sheets("Sheet1").Cells(61 + Ctr, 21).Value
Sheets("Usage").Cells(7 + Ctr,
Weekday(Sheets("Sheet1").Range("N2")) * 2).Value = DailyPallets(Ctr)
Next Ctr

Ctr = 0
For Ctr = 1 To 17
DailyRejectBags(Ctr) = Sheets("Sheet1").Cells(61 + Ctr,
23).Value
Sheets("Usage").Cells(7 + Ctr,
(Weekday(Sheets("Sheet1").Range("N2")) * 2) + 1).Value =
DailyRejectBags(Ctr)
Next Ctr

End Sub

 
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



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

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

About Us

"It's about Microsoft Excel"