How To Display The Ranges
May 1, 2009
how to display the ranges here is the assinment Your homework assignment will create a project that uses an array to store the sales figures for 20 employees at a computer store. Declare a 20-element one-dimensional array named Sales .
[Code]...
View 2 Replies
ADVERTISEMENT
May 25, 2009
i am a beginner learning vb.net. I have an excercise to create a form and on clicking the totals buttons it should display the number of employees who have earnt a salary within the ranges below. Now this code works, but i want to substitute the Select Case Statement with a more efficient for..next statment to increment my counter. The code is:
[Code]....
View 2 Replies
Jun 30, 2009
I am creating a program that takes into account pay from a job. I will try to describe the problem I am having using some psuedo code - so dont take syntax too seriously.
I created a structure that has some of the following values:
Name as String
Amount as Double
FrequencyType as MyEnumerator
MyEnumerator looks like this:
EveryTwoWeeks = 1
TwiceAMonth = 2
Weekly = 3
Now my problem is how do I add the date ranges into my structure?If your pay is weekly or twice a week, then I just need a single date because all other paydays should increment in 1 or 2 week blocks. But if the pay is twice a month I need two dates. It seems like there has got to be a better way then just having two dates in my structure and knowing that you just need the 2nd date if the FrequencyType is = 2 (TwiceAMonth).I was thinking that instead of a Structure I should use a class and then I could create a function that returns the date or dates depending on the enumeration type that you pass into it.What would be the "correct" way of doing this? I think I need a type of enumerator that allows for more then just integer type values.
[code]...
View 2 Replies
Feb 21, 2012
I am developing a billing application to help out the billing lady who has been doing our billing by hand. I am essentially done�. Except for one class of customer I can�t wrap my head around. Nuts and Bolts:
1.Data comes from a table that shows Storage id, customer id, Billing Start date, Billing end date.
2.I am kicking the data back out to a table and I�ll build her a nice little crystal she can run.
Problem:We rent storage space. If multiple customers use the same storage then they will split the cost of the daily fee. If there is 3 customers they each pay a third etc. This seems simple but If Customer 1 starts on 1/1/12 and ends 1/10/12 she pays 10 days. If Customer 2 comes in 1/3/12-1/9/12 they will split 7 days. If Customer 3 comes in only on 1/9/12 then they will all pay a third on that day. Now imagine this across 600+ storage units and 1000+ customers and each customer using multiple storage at any given time.
My biggest issue is I don�t know how to express how we do that calculation by hand programmatically. By hand process and how I figure I am eating the elephant: Find every Customer that has used the Space in the billing period -Determine the unique storage numbers that were used during the billing cycle kick the results to a storage table on an access database. I am using a table because I figured it would be less of burden for the application then a list or array.
Determine where there is overlap - Use �FOR� to cycle through the orginal data table using the unigue. Here is where I am stuck. How do I compare the dates in a way to determine which customer is using it when compared to the others. Obviously i can determine the difference in dates between the start and end. It is getting the applicaiton to recognize the dates are with in the other dates. here is kind of what I was thinking obviosly this doesn't work I am just using the format so don't crush me too bad because I code like a caveman.
Dim CustomerDifference as time span
Dim UniqueStorage as Integer
Dim Customer as string
[code]....
View 4 Replies
Jun 21, 2010
I am using Excel interop in my VB.NET program. My problem is that I can't seem to figure out how to write to Excel *and* define the Range using numbers.Alright, so I have objects being created depending on the file that the user opens. So there could be 100 objects or there could be none. Now each object has an array of values, and these arrays contain nearly 15000 elements. So here is what I want to do but I can't figure out how to escape using the LetterNumber:LetterNumber combination.
For every object I want a new column to be occupied and for every element in the objects array I want the row to be occupied. I figured the easiest way to do this was using a for loop but, again, I can't use numbers.
For columns = 0 to NumberOfObjects
For rows = 0 to NumberInArray
Cell(0,0).Value = myObjectsCollection(column).Array(rows)
Next
Next
View 3 Replies
Aug 10, 2010
I am using Excel interop in my VB.NET program. My problem is that I can't seem to figure out how to write to Excel and define the Range using numbers.
Alright, so I have objects being created depending on the file that the user opens. So there could be 100 objects or there could be none. Now each object has an array of values, and these arrays contain nearly 15000 elements. So here is what I want to do but I can't figure out how to escape using the LetterNumber:LetterNumber combination.
For every object I want a new column to be occupied and for every element in the objects array I want the row to be occupied. I figured the easiest way to do this was using a for loop but, again, I can't use numbers.
For columns = 0 to NumberOfObjects
For rows = 0 to NumberInArray
Cell(rows , columns).Value = myObjectsCollection(column).Array(rows)
Next
Next
View 1 Replies
Jun 16, 2011
What's up guys. Simple question today. How do you specify ranges of values for location? Basically i'm trying to write an if statement that will execute if a location matches a range of values, here is th snippet of my code im having trouble with:
If Player.Location = New Point(0 To 240, 240) Then code here
But that didn't work at all, there was no error, but the code just wouldn't execute when the "player" was in that range!
View 7 Replies
Aug 17, 2011
I have a collection as such
Private Shared ReadOnly thermoPaths As New ReadOnlyCollection(Of String) _
({
"thermometer_000_108x320.jpg",
"thermometer_010_108x320.jpg",
"thermometer_020_108x320.jpg",
"thermometer_030_108x320.jpg",
[Code]...
View 2 Replies
Nov 30, 2009
I am trying to make a program, where a user will input 'ranges' in a richtextbox, and then enter a value, which will be stored/categorized (in an array maybe) according to the 'range'.What I exactly mean is:
User specifies ranges by inputting this line in the richtextbox: <,10,20,30,> First range = < to 10 (no minimum boundary up to 10), second range = 10 to 20 , 3rd = 20 to 30 , 4th = 30 to > (30 to no maximum boundary) Then a user enters a number. For example "-1" would fall in the "< to 10" category, "23" in the "20 to 30" category, "125" in the "30 to >" category. I know there are other ways to do this, but I would like to see a solution (or some guidance) based on these requirements.
View 6 Replies
Jun 21, 2010
I'm performing some statistics on a txt file that has multiple columns using a collection list (vb.net 2008). My files can contain 100,000+ samples per file. How would I code my function to have it perform work on the first 3000 samples and continue the calculations on every 3000 samples thereafter?
Private Sub decimationButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles decimationButton.Click
Dim lines() As String = System.IO.File.ReadAllLines(inputFileName) '("TEXT_FILE")
Dim list As New List(Of Double())
[code]....
View 1 Replies
Sep 8, 2010
How to get the first row index of a named range in excel sheet from vb.net code...for example I set the column 1 of row 2 to column 5 of row 4 a range named it "MYRange" ( it is set from excel sheet )
View 1 Replies
Apr 12, 2012
I'm working on pasting arrays into excel ranges. Suppose I have a range: A1:A5 and an array a = {1,2,3,4,5}. I can set up the problem like this:[code]So, I got curious about the Transpose method, and whether I could construct my array properly so that I didn't need it. I found that Transpose converts my array into a 2d 1-based array (so the first element is (1,1) not (0,0) as usual).Now I'd like to know: Is there a standard VB-way other than the worksheet transpose function that I can use to build a 1-based 2D array the way Transpose does?
View 4 Replies
Jan 14, 2011
I want a combined Ranges. How do I combine two ranges into one?
Dim range1 as Excel.Range = osheetTemperatureData.Range("A7:"A10")
Dim range2 as Excel.Range = osheetTemperatureData.Range("C7:"C10")
Dim range3 as Excel.Range = range1 + range2 '????
View 1 Replies
Jan 2, 2012
The following code is excerpted from a larger procedure (the surrounding code is not relevant). why I am unable to get the second ContainsKey line to return True? Hint: try this on a worksheet with just a few populated cells to reduce looping.
For Each ws As Excel.Worksheet In Wb.Worksheets
Dim dic As New Dictionary(Of Excel.Range, String)
rngUsed = ws.UsedRange
[code]....
View 2 Replies
Aug 2, 2010
I have a variable called hour that will be used to display different text in a textbox based on what time it is. Basically, if the time falls between 12am and 3am, hour = 0, if the time is between 3am and 6am, the hour is 1, etc, breaking the day into 8 'hour's. How would I do this in vb?
View 7 Replies
Aug 9, 2008
This is my first program and have absolutely no training in programming Visual Basic Studio 2008 so forgive me if I have missed something obvious.Form3 contains a StartDate(Date Time Picker1)and EndDate(Date Time Picker2) with a button1 which launches a Form4 containing a report( Microsoft Report Veiwer)
I have been able to generate a report but it gives me everything in the database instead of date range selected.I have tried generating queries,stored procedures and writing additional code but nothing seems to work.( Though I may of but them in the wrong place)
View 2 Replies
Sep 23, 2010
how to get list of all named ranges in an excel sheet.
View 5 Replies
Nov 4, 2010
I created an e-mail program in VB2008. I have an excel file with a list of all e-mail addresses and attachments to those e-mail addresses. What I want to do is import thethe e-mail addresses and attachments into my program. I want my program to then take each e-mail address (automatically) and insert them with their attachments into their respectable fields in the program. The primary objective is to insert 200 e-mail addresses and attachments. Each attachement is significant to each e-mail address.
[Code]...
View 2 Replies
Jul 15, 2009
Is it possible in VB to reference named ranges in an excel spreadsheet and pull the correct data?
View 1 Replies
Apr 29, 2010
I need to calculate the location of intersections between multiple date ranges, and the number of overlapping intersections. Then I need to show which date/time ranges overlap each of those intersecting sections. It is slightly more complicated than that so I'll do my best to explain by providing an example. I am working in VB.Net, but C# examples are acceptable as well as I work in both.
We have several high risk tasks that involve the same system. Below I have three example jobs named HR1/2/3/4 with start and end date/times.
HR1 {1/6/2010 10:00 - 1/6/2010 15:00}
HR2 {1/6/2010 11:00 - 1/6/2010 18:00}
HR3 {1/6/2010 12:00 - 1/6/2010 14:00}
[Code]....
View 1 Replies
Aug 17, 2011
I have to compare two columns in two different Excel sheets and delete the duplicates. I have come up with several strategies that work, but I am searching for the most efficient way to do this. At first, I was sorting the columns and looping through them in the manner of a sequential update and deleting when the cell values were equal. But I discovered here an article by Mike Rosenblum that explained that it is much more efficient to stick the columns into an array and iterate them from there. So I was able to do that. There was a complication in that once I had deleted a row, then the array and the spreadsheet were out of sync. So I had to compensate by incrementing a variable each time a row was deleted, and subtracting this variable from the array index to calculate the row to be deleted in the spreadsheet.
So now I am wondering whether there is a better strategy. I thought that if I could merely hide the rows to be deleted and then find a way to delete all hidden rows at once after the loop was over, then this would eliminate the problem of the array and the spreadsheet getting out of sync and would make the code easier to understand. I thought of putting the row numbers of the duplicates into another array and deleting the rows after the comparing loop. But this creates the same problem of having to compensate the row numbers in the array.
View 1 Replies
Jun 21, 2010
What I am trying to create is a log in system, and in one of my forms I want to limit the date entered into a form. For example a user cannot enter a date more than seven days from todays date Which is what i achieved but what i am stuck on is preventing a user entering a date in the future
[Code]...
View 5 Replies
Mar 16, 2012
I am writing a personal accountant software using VB2010. What I'm looking for now is to get the week date range of a specific date (Monday to Sunday). For example, if the given date is 16/03/2012, I want to get back:12/03/2012 -> 18/03/2012
View 5 Replies
Mar 18, 2012
I am trying to read a 16bit binary file (tif image) and pixel values of the image ranges from 1200 to 4500. I tried to use BinaryReader using ReadUInt16 but I get EndOfStreamException Unhandled error. ReadByte method works fine with an 8bit tif file. I do not know how to read a 16bit image file using binaryReader. Shouldn't I use ReadUInt16 since values of pixels range from 1200 to 4500?
[Code]....
View 10 Replies
Feb 28, 2012
Cannot get list box to display each increment and cannot get data to save correctly in order to display.
Public Class Projectile_Motion
Dim initialHeight As Double ' Holds beginning height
Dim initialVelocity As Double ' holds velocity
[code]....
View 14 Replies
Apr 8, 2011
I have a problem in timers, I want to display 2 forms each one after 3 and 5, how to do that? I mean when the first form appears, after 3 seconds another one will appear, then after 5 seconds the second will appear. I have a code where someone gave me here but its for message box only, thus I modify it to put a form still does not work. Here the code I put in the timer below:
Private Sub frmblabla_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
tmrnote.Start()
Private Sub tmrnote_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrnote.Tick[code]....
I still have problem when the message box stops, it displays all the forms together. All I want is when the message box stops, then it display the first form then stop to display the second then stop to display the last. The first form must stay for 3 seconds on the screen, then after 3 seconds the second appears then after 5 seconds the last appears.
View 2 Replies
Jun 1, 2011
In trying to test some graphic features, I am trying to get them to display on load so button doesn't have to be pressed. I used the following code as suggested from forum. Message boxes run but ellipses aren't displayed until button is clicked which is what I am trying to avoid!
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.PerformClick()
Button1_Click(Nothing, Nothing)
[code]....
View 5 Replies
Dec 19, 2009
Im trying to make a custom splash screen , but i cant seem to get it to work. Im trying to display a welcome screen for 3 seconds then close and display form1 (main form).Heres my current code.
[Code]...
View 2 Replies
Oct 19, 2009
i have to create a mortgage calculator (I know we have killed this mortgage calculator). Has to display an amortization table to display the list after doing the calculation. Here is the actual assignment:
Write the program in VB.Net (not Web based) and have it accept user input of the amount, term and interest rate. Display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. The list will be longer than the screen, so use loops to display a partial list, hesitate, and then display more of the list. Insert comments to document the program.
I have created 4 buttons. Calculate, Clear, List, and Exit. The buttons all work, but the list does not. Not sure what i am doing wrong.
[Code]...
View 2 Replies
Oct 29, 2009
QuoteI would like to display my password from database (MS Access)into datagrid but in invisible. Below is my coding retrieve data from database, but my password is visible,
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = " & connectionpath
con.Open()
[Code].....
View 7 Replies