Solved

increasing value by 1 in vba excel

Posted on 2014-01-22
2
243 Views
Last Modified: 2014-01-22
Hi,
I am trying to increase a value by 1, and decrease a value by 1 using a vba macro in excel.

i tried to give a go, but having some issues with my code. It's highlighting .Sheets saying "invalid of unqualified reference".

Thanks,

Sub RollDates()
    With .Sheets("F&O Daily")
     .Range("M82").Value = .Range("M82").Value + 1
     .Range("M88").Value = .Range("M88").Value + 1
     MsgBox "Dates Rolled"
End Sub

Open in new window

0
Comment
Question by:jfrank14
2 Comments
 
LVL 10

Accepted Solution

by:
Anthony Berenguel earned 500 total points
ID: 39800703
try
Sub RollDates()
    With Sheets("input")
        .Range("M82").Value = .Range("M82").Value + 1
        .Range("M88").Value = .Range("M88").Value + 1
        MsgBox "Dates Rolled"
     End With
End Sub

Open in new window

0
 

Author Closing Comment

by:jfrank14
ID: 39800770
perfect, thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now