ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Still having VBA problems (https://www.excelbanter.com/excel-discussion-misc-queries/240475-still-having-vba-problems.html)

Preschool Mike

Still having VBA problems
 
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")
--
Gary''s Student - gsnu200901

--
Mike Mast
Special Education Preschool Teacher

Don Guillett

Still having VBA problems
 
Try this idea where your variable is PUBLIC. Copy these into a modulef5
usemyvar to see nothingthen 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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Preschool Mike" wrote in message
...
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")
--
Gary''s Student - gsnu200901

--
Mike Mast
Special Education Preschool Teacher




All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com