macro help please

G

Guest

Hi i'm using the following macro to print a range and add 1 to a cell what i
need it to do is add a number from a cell and then reset to 1, anyone help
please

Sub Button2_Click()
Sheets("Sheet1").Range("E10").Value = _
Sheets("Sheet1").Range("E10").Value + 1
ActiveSheet.Range("Y4:AA12").PrintOut preview:=False
End Sub
 
B

Bob Phillips

Sub Button2_Click()
With Sheets("Sheet1")
.Range("E10").Value = _
.Range("E10").Value + .Range("A1").Value
.Range("A1").Value = 1
End With
ActiveSheet.Range("Y4:AA12").PrintOut preview:=False
End Sub

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
G

Guest

Thanks Bob your always a great help, can you make it so it prints the number
before it resets it to 1 please
 
B

Bob Phillips

Sub Button2_Click()
With Sheets("Sheet1")
.Range("E10").Value = _
.Range("E10").Value + .Range("A1").Value
ActiveSheet.Range("Y4:AA12").PrintOut preview:=False
.Range("A1").Value = 1
End With
End Sub


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

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