cmoore3984
06-21-2011, 11:52 AM
This is easy, but I just cannot get there.
I am using Excel 2007.
I want cell O1 to equal the new test value at end of this macro. To begin Cell O1 = 0. After the macro runs the first time it should equal 1, runs a second time = 2, etc. It does not change with what I have below. Please advise.:banghead:
Dim Test As Integer
Test = Range("O1")
If Test = 0 Then
ActiveWindow.SmallScroll Down:=24
Range("B43:B46").Select
Selection.Copy
Range("C43").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10:B23").Select
Selection.ClearContents
Range("B9").Select
End If
If Test = 1 Then
ActiveWindow.SmallScroll Down:=24
Range("B43:B46").Select
Selection.Copy
Range("D43").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10:B23").Select
Selection.ClearContents
Range("B9").Select
End If
If Test = 2 Then
ActiveWindow.SmallScroll Down:=24
Range("B43:B46").Select
Selection.Copy
Range("E43").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10:B23").Select
Selection.ClearContents
Range("B9").Select
End If
If Test > 2 Then
MsgBox ("Please start a new document, this one is full")
End If
Test = Test + 1
Range("O1").Value = Test
End Sub
I am using Excel 2007.
I want cell O1 to equal the new test value at end of this macro. To begin Cell O1 = 0. After the macro runs the first time it should equal 1, runs a second time = 2, etc. It does not change with what I have below. Please advise.:banghead:
Dim Test As Integer
Test = Range("O1")
If Test = 0 Then
ActiveWindow.SmallScroll Down:=24
Range("B43:B46").Select
Selection.Copy
Range("C43").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10:B23").Select
Selection.ClearContents
Range("B9").Select
End If
If Test = 1 Then
ActiveWindow.SmallScroll Down:=24
Range("B43:B46").Select
Selection.Copy
Range("D43").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10:B23").Select
Selection.ClearContents
Range("B9").Select
End If
If Test = 2 Then
ActiveWindow.SmallScroll Down:=24
Range("B43:B46").Select
Selection.Copy
Range("E43").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10:B23").Select
Selection.ClearContents
Range("B9").Select
End If
If Test > 2 Then
MsgBox ("Please start a new document, this one is full")
End If
Test = Test + 1
Range("O1").Value = Test
End Sub