Solved

increasing value by 1 in vba excel

Posted on 2014-01-22
2
231 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
Comment Utility
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
Comment Utility
perfect, thank you!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Outlook Free & Paid Tools
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

744 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

13 Experts available now in Live!

Get 1:1 Help Now