Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

increasing value by 1 in vba excel

Posted on 2014-01-22
2
Medium Priority
?
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Anthony Berenguel earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

636 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