Zachary902
New Member
- Joined
- Nov 5, 2013
- Messages
- 7
I get this warning when i run my code, and cannot figure out what it means? Would somone be able to tell me?
I only have one case within my case statements because i am in the beginning stages.
What the program is suppose to do is find the intersection of the two ranges set by the case statments and add the daily hours to the current hours in that cell that was found at the intersection.
Dim MonthName As String
Dim CropName As String
Dim CurrentHrs As Integer
Dim DailyHrs As Integer
Dim Rng1 As Range
Dim Rng2 As Range
Sheets("278DH## Daily Summary").Select
MonthName = Range("E2")
CropName = Range("E13")
Sheets("Crop Hours Log").Select
Select Case CropName
Case "Wheat"
'Set Rng1 = currentWorksheet.Range(currentWorksheet.Cells(3, 5), currentWorksheet.Cells(14, 5))
Set Rng1 = Range("E3:E14")
End Select
Select Case MonthName
Case "January"
'Set Rng1 = currentWorksheet.Range(currentWorksheet.Cells(3, 5), currentWorksheet.Cells(3, 42))
Set Rng1 = Range("E3:AP3")
End Select
Application.Intersect(Range(Rng1), Range(Rng2)).Select
Selection = CurrentHrs
Range("G30").Select
Selection = DailyHrs
CurrentHrs = CurrentHrs + DailyHrs
Application.Intersect(Range(Rng1), Range(Rng2)).Select
Selection.Paste
End Sub
I only have one case within my case statements because i am in the beginning stages.
What the program is suppose to do is find the intersection of the two ranges set by the case statments and add the daily hours to the current hours in that cell that was found at the intersection.
Dim MonthName As String
Dim CropName As String
Dim CurrentHrs As Integer
Dim DailyHrs As Integer
Dim Rng1 As Range
Dim Rng2 As Range
Sheets("278DH## Daily Summary").Select
MonthName = Range("E2")
CropName = Range("E13")
Sheets("Crop Hours Log").Select
Select Case CropName
Case "Wheat"
'Set Rng1 = currentWorksheet.Range(currentWorksheet.Cells(3, 5), currentWorksheet.Cells(14, 5))
Set Rng1 = Range("E3:E14")
End Select
Select Case MonthName
Case "January"
'Set Rng1 = currentWorksheet.Range(currentWorksheet.Cells(3, 5), currentWorksheet.Cells(3, 42))
Set Rng1 = Range("E3:AP3")
End Select
Application.Intersect(Range(Rng1), Range(Rng2)).Select
Selection = CurrentHrs
Range("G30").Select
Selection = DailyHrs
CurrentHrs = CurrentHrs + DailyHrs
Application.Intersect(Range(Rng1), Range(Rng2)).Select
Selection.Paste
End Sub