Solved

InputBoxes and Variables

Posted on 2008-10-25
3
225 Views
Last Modified: 2013-11-25
Hi,

I'm using VBA for Excel. I created 2 different variables, vntMonth as a variant and intMonth as an integer. I assigned vntMonth to an inputbox for a user to enter a month. I wanted this to be an integer so i ran it through error-checking using the IsInteger function and If-Else statements. Now I'd like to store this validated version of vntMonth as an integer, therefore using the variable intMonth. How do I do this? What code would I write?
0
Comment
Question by:azmeen123
[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
3 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 22806092
If you have validated vntMonth already, then:

    Dim vntMonth As String
    Dim intMonth As Integer
    ...
    intMonth = CInt(vntMonth)
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 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