add 1 to the value in a cell

P

pls123

hi all !! good afternoon !!!

i want to remerciate the microsoft forum for the precious help.

i need this:

If "my.condition.true" Then
add 1 to the value of cell "b5"
End If

Ty all for interesting !!
 
R

Ron de Bruin

Hi pls123

With Sheets("Sheet1")
.Range("B5").Value = .Range("B5").Value + 1
End With
 
R

Ron de Bruin

Hi
i don't understand the needing of " with " !!

Now I only have to use Sheets("Sheet1") one time and if I want to edit the sheet name
I only have to do it one time

This is the same

Sheets("Sheet1") .Range("B5").Value = Sheets("Sheet1") .Range("B5").Value +1
 
Top