Arranging Numbers - Get Equal Numbers And ELSE Giving All Series?

Dec 26, 2010

Sub five()
Dim i As Integer
For i = 1 To 14[code].....

I want the numbers that I was comparing similar numbers. I get equal numbers and ELSE giving all series.I like numbers 2 4 6 8 9 10

View 1 Replies


ADVERTISEMENT

VS 2008 - Add Two Excel Sheets With Numbers And The Equal (similar) Numbers To Save Once

Mar 28, 2010

how can i add two excel sheets with numbers and the equal (similar)numbers to save once

View 1 Replies

How To Generate Four Random Numbers Equal To 100

Mar 15, 2012

i will like to generate four numbers at random, that will total 100 and assign each to a textbox.

View 6 Replies

Numbers - Force A Calculation Result If Less Than Zero To Equal Zero?

May 18, 2012

I've a very simple situation, which of course I can overcome with logic, but is there a built in VB function to ensure the following:

Dim price
Dim subsidy
if price - subsidy <= 0 then
price = 0
end if

In practical terms, I've lots of other things going on to calculate price, so I want to simplify this to:

Dim price = calculatedPrice - subsidy

and wrap that into some VB formating that ensures if price ever becomes negative it's forced to zero.

I'm thinking that a simple "Type" conversion might do it, but am not sure which type would suit.

View 1 Replies

VS 2008 - Finding 3 Equal Numbers Out Of 5 Random

Apr 23, 2011

I have a program I'm working on (a chance game) that has 5 random numbers generated. I need to think of an expression to check to see if three of those numbers are equal. The random values are not an array, they are 5 separate variables. I have the code written to compare if there are two matching ones, but am having trouble thinking past that. [Code]

View 3 Replies

VS 2008 When Type A Number To Colorize The Equal Numbers

Jan 8, 2010

i have a textbox and 48 labels in 6 rows 8*6=48 i want when i type a number example 210456 to colorize in red the eual numbers in the labels

View 5 Replies

Series Of Numbers (separated By A Comma) And Find Average

Mar 11, 2010

I am new to VB and need to make a program that does the following:Write a VB.Net program that allows users to enter a series of numbers(separated by a comma) in a text box called series. When the users clicks the command button called Average, the program extracts the number one by one from the series and calculates the average, and outputs the average onto a textbox called Result.I understand how to get it to do the average, but how can I make the program count the numbers that I input and then divided by the sum? Also, how would i get it started.

View 2 Replies

Form A Regex To Get The Numbers From A Giving String With Certain Conditions?

Nov 1, 2011

I have a string like this

(THQ836721='Yes' and BRQ836716='Yes') or (BRQ836717='Yes') and (THQ836728='Yes' and BRQ836756='Yes') or (BRQ836117='Yes') and (SYSQ123='No')

I need a Reg Ex to get the numbers after THQ,BRQ and SYSQMy string may smaller or shorter or may have any times of this THQ,BRQ or SYSQ.form a Reg eXpression to get the numbers .The length of numbers may vary I am using VB.Net in VS2008?

View 1 Replies

Make An Application Where When The User Clicks A Button, It Generates A Series Of 100 Random Numbers Between 1 And 1000

Mar 15, 2011

I'm trying to make an application where when the user clicks a button, it generates a series of 100 random numbers between 1 and 1000, and then saves those numbers in a text file. All I could come up with is generating ONE random number, but I can't figure out how to make it 100. Here is what I have:

[Code]...

View 4 Replies

Create Another Six Textboxes / Same Time Allocate These Numbers In Ascending / Descending Numbers.

Jun 21, 2010

I have six textboxes, and upon button press it randomly generates six numbers, one in eact text box e.g. [43] [85] [93] [1] [0] [17]..i create another six textboxes and at the same time allocate these numbers in ascending/descending numbers.I am not looking for any codes whatsoever, as i love the challenge of VB.Net.

View 2 Replies

Project - Average Numbers, Maximum And Minimum Values, Range Of The Numbers

Apr 7, 2009

Im trying to write a program that will do:

1.The average of the four numbers. This answer will be placed into a text box reserved for that value. This text box cannot be changed by the user.

2.The maximum and minimum values. These will be denoted by changing the color of the largest number green and the smallest number red.

3.The range of the numbers. The range is defined as the difference between the largest and smallest numbers. The range will be placed into its own text box, labeled as such. This text box cannot be changed by the user."

Im using visual studio 2008 and it has to be written in VB

View 35 Replies

Use .next (random Numbers) To Randomly Select Something From A List Of Numbers But It Can't Repeat The Number?

Aug 16, 2009

So how would I use .next (random numbers) to randomly select something from a list of numbers but it can't repeat the number?I could do:

dim num as integer
dim r as new random
num = r.next(1,5)
if num = 1 then
elseif num = 2 then
etc.

That wouldn't work because it would repeat.If I donwload someone's game can I disect it in VS? :0 I tried going to open project, then I went to the folder and clicked open. It brought me inside of the folder so I tried to open the game but there is no form1 there. It says the games name then .exe in the explorer-like thing in the top right?Also, how would I have a value or something in a label and access it from a button.

Example:This is in a label.

Dim number as Integer
number = 0

Then in the button do

Label.number = 0

How would I do something like that? I want to use that a lot as I did in a different language.

View 6 Replies

User To Input Numbers From An Inputbox And It Displays The Total Numbers Entered?

Mar 18, 2011

I have a program that allows a user to input numbers from an inputbox and it displays the Total numbers entered, the sum of the numbers entered, and the average of the numbers entered. What I can not seem to find it how to have it display the largest number entered. The code I have so far is,

[Code]...

View 11 Replies

Box - Conversion Error - User Enters 6 Numbers In 6 Different Text Boxes - Displays The Larger Of Those 6 Numbers

Oct 4, 2011

I am making a program, where the user enters 6 numbers in 6 different text boxes, and it displays the larger of those 6 numbers. But I also want to make it where if the user enters a string value (like S for instance) in the text boxes, it gives an message and says "please enter the numbers again" and the user gets to enter the 6 numbers again. But when I do try to do that, it gives an error message saying conversion from "w/e the user entered" to Double is not valid. If the user just enters the numbers, it works fine. However, I am trying to make it if the user does enter non numeric value, it gives a message window and the user can reenter the numbers again.

Here is my code Example

CODE:

This is where I am trying to use IsNumeric to show a message if a user does not enter a string so the user can renter the numbers again, but when the user does enter a string value (say in textbox 1) it gives me an error message saying conversion from "S" to 'double' is not valid.

CODE:

Then right here this is where I have my series of ifs statements, this part works fine, it displays the largest numbers of the 6 textboxes every time. Error free.

CODE:

And do this with variable number 2, 3, 4, 5.

I know there are easier ways to do these with arrays and stuff. But I am not there yet. I am still learning about ifs and stuff.

View 8 Replies

Program To Randomly Select Numbers For A Bingo Caller - Prevent Reversed Numbers Being Selected

Mar 6, 2011

I have just about completed a .NET project to write a program to randomly select numbers for a Bingo caller. Over the last month or so Ive learned a lot about .NET but heres something that I consider to be odd and maybe one of you guys can offer an opinion.

One of the features of calling Bingo in a small local club is that callers often use little sayings to accompany certain numbers, I expect youve all heard of (say) All the sixes, clickety click for 66 or 5 and 9 the Brighton line for 59 etc. My little program gives an option to incorporate these with a prompt for the caller that can be edited outside of the program. One of these conventional sayings is used when a number is reversed 12 followed by 21 or 45 followed by 54 for example, when the caller might call (say) 1 and 2, one dozen, number 12 And the other way round 2 and 1, twenty one.

So, I programmed in a bit of code to detect this and to over-ride whatever might otherwise have been the quote with And the other way round and set about testing it. Ive been through literally dozens of full 90 calls watching for the occurrence of a reversed number, spent a few hours doing it, and not once has it occurred which is to say the least, unusual.

So, Im wondering about the Rand Function, could it be that it isnt possible for a reversed number to be selected? Just so you know, I randomly pre-select the order of all 90 numbers, I fill each of the 90 elements of an array with a random number first checking that the number selected hasnt already been stored, if it has, I just get the next random number (and check that too of course), but I cant see how that could prevent reversed numbers being selected, especially in light of the fact that frequently it's not the 'next' number that's used.

View 39 Replies

Generate Automatic Numbers For Order Number And Inquiry Numbers?

Feb 15, 2012

am writing an system application for a company that must generate inquiry id and order id automatically. Whenever a customer makes a new inquiry or new order by clicking the add button, an automatic number should be displayed in the text box and when it's saved, it should be saved in the database access.

View 9 Replies

Sort Strings With Numbers When Want Numbers Sorted Based On Their Dimension?

Nov 9, 2010

How do you sort strings with numbers when you want numbers sorted based on their dimension?

View 19 Replies

Combine Multiple Numbers And Know What Numbers Are Selected Later From One Number?

Aug 18, 2009

I would like to know how I can have an enumeration that has multiple values and can be passed to a function.

Example:

Public
Enum
ActionEnum
NoAction = 0

[code]....

View 9 Replies

Fibonacci Numbers: Display First 10 Finonacci Numbers In Sequence

Mar 11, 2012

I am working on an assignment that will display the forst 10 fibonacci numbers in sequence. However when my results are displayed, the numbers are all stacked on top of each other like this: 011235813213455. I have tried to play with it but i can't seem to get my numbeers to space out or even maybe have a comma "," betweeen each number.[code]

View 2 Replies

Generate 6 Unique Random Numbers - Sometimes Get Duplicate Numbers ?

Oct 6, 2011

The program must generate 6 unique random numbers but when I click display numbers sometimes it gives me 6 unique numbers and sometimes I get duplicate numbers. I will add the code I have so far.

Public Class frmMain

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click

[CODE]...

View 9 Replies

Limit Textbox Input To Numbers And Range Of Numbers

Apr 4, 2012

i have one more issues, and hope is the last for now. How can I limit a textboxe's input to only numerical with certain range of values (eg -10 to 10) and with that happening while I type in the values?

View 9 Replies

Make A Program That Will Calculate Sum Of Consecutive Numbers Between Two Given Numbers

Jun 4, 2012

I'm trying to make a program that will calculate the sum of consecutive numbers between two given numbers. [code]

View 13 Replies

Sum Numbers In Listbox - Add All Numbers Together And Display The Result In A Label

Jan 10, 2010

I'm using VB08. I've populated a listbox with numbers and I want to add all those numbers together and display the result in a Label. I've heard about using parse but I don't understand exactly how it works.

This is the code that I have that i think should work.

Dim lblTotal As Decimal
Dim sum As Double
For Each decAdded As Decimal In Me.lstRunningTotal.Items
sum += Double.Parse(decAdded)
Next
lblTotal = FormatCurrency(sum)

When I run it, nothing happens. My "For Each" statement I'm not sure if it's doing what I think it's doing. I can't believe I spent 6 hours banging my head against the wall but I finally got it figured out.

This is my revised code:

Dim sum As Decimal
For Each decAdded As Decimal In Me.lstRunningTotal.Items
sum += Decimal.Parse(decAdded)
Next
lbl_Total.Text = sum

Just some suttle changes made the difference

View 1 Replies

Inputting Numbers Into A Textbox And Formating The Numbers?

Jul 30, 2009

I just D/L VB express 8, and I'm trying to learn how to use it. what I'm trying to do is write some code that:takes a number into a text box (textbox1.text)do some simple calculations with that number when I press a button (button1)display the results in a second text box 9textbox2.textThe first problem I am having:The numbers are in the "milli" range, meaning to the power of negative three, so 10^-3 = 0.01 I do not want to enter 10^-3 or any other exponent into the textbox, I am simply entering in 10 because all my units will be in milli. I've tried using exponent and scientific notation but it doesn't calculate correctly. I've done a "work around" to get it to do what I want, but there has to be a simpler way to achieve the above results without. for example, the user enters 10 into the textbox, the button multiplies 10^-3 *30, as a crude example, and stroes that value (say, B=10^-3*30) and B is DIM B as Double.

Problem number two:Error checking. I need to validate that only numbers can be entered into the textbox, or else the program will display an error message (messagebox). I can achieve this to some degree with sample code from here and other places, but, some of the code does not take into account that some numbers have decimal places (I have foud code that does, and it does work), but if a users enters, say the letter "E", it crashes the program. If the user enters "10.3Z", it crashes the program. I cannot seem to code for the last case, a mixture of numbers and letters to get an error message box.

View 11 Replies

Truncating Numbers To Remain It Two Numbers (Not Decimal)?

Mar 19, 2009

I have an id called "AM01". I separated them by truncating the numbers out and increase it by 1 each time I want to add a new record. Therefore before I add the record, I would have to combine them back. I managed to truncate them and combine them back. However, the results turn out to be "AM2" instead of "AM02". So, is there a way where I could make the numbers as "02" instead of just "2"?

View 6 Replies

Adds Numbers Between 2 Inputed Numbers

Oct 26, 2009

I am very new to visual basic and was recently asked to teach a course without any formal training. I am writing a program that adds the numbers between 2 inputed numbers. I need to display the sum of the numbers between the inputed numbers and the expression used to create the sum.For example: If 10 and 15 were inputed the answer label would display the following 10+11+12+13+14+15=75..The code is properly generating the sum but I can not figure out how to display the expression used to generate the sum. [code]

View 4 Replies

Divide Two Numbers Together And They Should Be 2 Random Numbers From 1-12?

Jan 10, 2010

Basically, I want to divide two numbers together and they should be 2 random numbers from 1-12 (I have done that part) but, the answer should be a whole number (i.e. Integer, so no decimal points etc) So, I did the following:

' Initialize the random-number generator.
Randomize()
' Generate random value between 1 and 12.
Dim value5 As Integer = CInt(Int((12 * Rnd()) + 1))

[code]....

but the problem here is that the program crashes after only a few clicks on the button. So I guess the question is: How can I make the program generate two numbers (from 1-12) that when divided become a whole number?(Is there any code that may tell the random generator that I want the numbers to be even?-so all even numbers from 1-12?)

View 2 Replies

Let Textbox1 Only Enter Positive Whole Numbers And Positive Decimal Numbers?

Jan 10, 2012

How to let textbox1 only enter positive whole numbers and positive decimal numbers

View 4 Replies

Find Even Numbers Between Two Numbers?

Jun 5, 2012

i'm trying to get my course done for this class. My question is find the even numbers from 6 through 16. The thing is i'm working with events. How should i do this? i did a lot of research and i did find some code that might work but i'm not sure how it works and understand it. I'm by no means advanced with vb.net i'm just trying to finish this course. What i did find was that i have to use MOD? I'm not even really sure how i can use that with an event? Any code would be awesome to getting me on the road to finish this assignment.

I took this code out of a program that had to find even numbers and it works great but the only downfall is that it starts from 1 and then whatever number you want it to stop at. I only need 6 through 16 .

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Diagnostics

[Code]....

View 3 Replies

Addition Of Odd Numbers / Addition Of Small Numbers

Feb 28, 2010

i need help how to add odd numbers that are in my 6 textboxes collection and to see the result to label1 and how to add the textboxes that have numbers less than number 5.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved