Still having VBA problems

  • Thread starter Thread starter Preschool Mike
  • Start date Start date
P

Preschool Mike

What I'm trying to do is collect the contents of cell BC8 on Sheet (Grade1)
if the cell E5 on sheet (Grade1) says August and store the information in my
Dim AugustG1A statment. Then using my InsertFirstGrade sub I want to send
the information in AugustG1A to cell T7 on sheet (SpGrade1). Any help
writing this correctly would be much appreciated. My Collect1stGrade does
not collect the contents of sheet (Grade1) from cell (E5) and store it in the
Dim AugustG1A.

Dim AugustG1A As Integer


Sub ClearMonths()
AugustG1A = 0

End Sub



Sub Collect1stGrade() 'This code does not work
If Range("'Grade1'!E5") = "August" Then
AugustG1A = Range("'Goal1'!BC8")
End If
End Sub


Sub InsertFirstGrade()
Range("'SpGrade1'!T7") = AugustG1A
End Sub

I tried this suggested code but it did not work as well.

For the VBA part:

replace:
Range("'Grade1'!E5")
with:
Sheets("Grade1").Range("E5")
 
Try this idea where your variable is PUBLIC. Copy these into a module>f5
usemyvar to see nothing>then f5 putmyvar and then execute usemyvar. The
public is erased on leaving the file.

Public myvar

Sub putmyvar()
myvar = 2
End Sub

Sub usemyvar()
MsgBox myvar
End Sub
 
Back
Top