i have two parts of a solution but can still not get it to run

  • Thread starter tracks via OfficeKB.com
  • Start date
T

tracks via OfficeKB.com

i am going to explain what i am trying to do,so things will hopefully be more
understandable.
i have a workbook with 4 worksheets, ie, Daily Production,Daily Crane Info,
Crane Wt Summary,
Calender Summary. production is entered into Daily Production and copied to
Daily Crane Info. The information is manipulated and generates information
that is placed in the range AA15:AF15.
I need to copy the date in cell I7 and the information in AA15:AF15 to Crane
Wt Summary starting at A7to E7and that information for each production date
is tabulated ,. when the daily production is for a new month the information
in Crane Wt Summary pasted to Calender Summary and Crane Wt Summary is
cleared and new month enteries fill into appropriate place. the following is
the code i have so far , much of due to the good people on this website. ALL
help greatly appreciated

Sub CO()
Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range
Set rng1 = Worksheets("DAILY CRANE INFO").Range("I7")

With Worksheets("CRANE WT SUMMARY")
Set LASTROW2 = .Cells(Rows.Count, 1).End(xlUp)
Set LASTROW3 = .Cells(Rows.Count, 7).End(xlUp)
Set rng2 = Worksheets("CRANE WT SUMMARY").Range("LASTROW2")
Set rng3 = Worksheets("CRANE WT SUMMARY").Range("A3:LASTROW3")
End With

If Month(rng1) > Month(rng2) Then
Range("rng3").Copy _
Worksheets("CALENDER SUMMARY").Range("A1:E31").Offset(X, Y)
( i require the information for the months to be stored in Calender
Summary in a 4 month across
3 months down array)

Worksheets("CRANE WT SUMMARY").Range("A7:G31").Select
Application.CutCopyMode = False
Selection.ClearContents

Else: Call Sheet2.test

End If

End Sub


Sub test()


Dim DestCell As Range

With Worksheets("crane wt summary")
Set DestCell = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
End With

With Worksheets("daily crane info")
.Range("I7").Copy
DestCell.PasteSpecial Paste:=xlPasteValues


.Range("AA15:AF15").Copy
DestCell.Offset(0, 1).PasteSpecial Paste:=xlPasteValues

End With


With Worksheets("DAILY PRODUCTION")
.Range("C9:D44").Select
Application.CutCopyMode = False
Section.ClearContents

.Range("F9:G44").Select
Application.CutCopyMode = False
Selection.ClearContents

End With

End Sub

Rick Mason
 
J

JLGWhiz

I notice that you are copying AA15:AF15 (6 cells) to A7:E7 (5 cells). You
lose 1 cell in the process. You also fail to explain what you want to do
with I7 once it is copied. The easiest way to explain what you need help
with is to show a data base (worksheet) layout example, identifiy the cells,
columns or rows that you want to work with and state what you want to do with
the data within those containers.
Sometimes it is helpful to understand who uses the data, or who works with
it, but it is not essential. Posting the code you are using is a plus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top