Extracting Values From A Range
Aug 13, 2011I am new to writing Macro's. I need to know how can we separate individual values from a range (say 3-5, 0-4, 5-2 etc.)
View 2 RepliesI am new to writing Macro's. I need to know how can we separate individual values from a range (say 3-5, 0-4, 5-2 etc.)
View 2 RepliesI am looking to pull a specific time of data from my sql Data Base, Is this correct or is there a different way to do it?
Dim sqlShift As String = "SELECT * FROM ShiftTasks WHERE Shift=@Shift, Time>=@Time1 and Time<=@Time2 ORDER BY [Shift], [Time], [Priority] DESC"
Using Con As New SqlConnection(ConnectionString)
[code]....
I found it, Needed to replace the , in the SQLShift String with an and
Dim sqlShift As String = "SELECT * FROM ShiftTasks WHERE Shift=@Shift and Time>=@Time1 and Time<=@Time2 ORDER BY [Shift], [Time], [Priority] DESC"
Im using lockbits to get some img data and the img depth is 24 bit. This means that when i read the values from memory I get the following result. BLUE GREEN RED And I need them in the RED GREEN BLUE Format. I don't know if i can just reverse the bits (i don't know how) or if i need to extract the the values independently(I also don't know how to do this.
View 9 Replieshow to capture the 'ID' literals from the following xml file example using VS and VB 2010. I plan to assign it to a temp variable for later use.
<?xml version="1.0" encoding="utf-8"?>
<Rows>
<Row Sortorder="1">
[code]....
I have a combo box which is databound at run time & I need to iterate through it to get all the values in it (not display items) & then add these to an array or collection.
View 2 RepliesI am interested in finding out how I can add and extract cell values in open office calc using VB.net.
View 1 RepliesI have 14 values, that change constantly. I need to know how to check each value against each other to see if they are within 250 of each other. [code] I want these two values in the listbox to blink red in the list box. but i always want each value to check every value in the list box. i dont even know where to start short of programming each possibilty with a if than statement and that would take forever
View 1 RepliesI was just wondering how to extract or parse any particual tags (whichever I specify) from webpages. I know how to extract text and links from webpages, but I tried to use the same method from the following code for div tags, title tags etcetera and it doesn't seem to work:
[Code]...
how do i generate random double values between range, for example:value between 2.50 to 3.50?
View 7 RepliesI am coding a lottery number generator for a homework assignment. My project needs to have functions that return random values based on a range given. The first function I am coding is for a pick 3 lottery game.The function should return three random numbers between 1 and 9. I have coded the function but it only returns one number. When the debugger runs it says my function does not return a value on all codepaths.
[Code]...
i'm trying to do a filename compare, sort of fuzzy match.Here's what code i have.First of all i load 2 directory's into 2 listbox's as strings and remove the filepath. Directory1
Code:
TextBox1.Text = FolderBrowserDialog1.SelectedPath
If TextBox1.Text = "" Then
Else
Then when i click the compare button i am trying to pass listbox1 and listbox2 through Distance and return the resulting fuzzy file matches.
Code:
Dim MyObject As New StringSift2
Dim ReturnVal As Single
ReturnVal = MyObject.Distance(ListBox1.SelectedItem, ListBox2.SelectedItem)
[code]....
But i get this error.
Code:
TreeView1.Nodes(lb1).Nodes.Add(ReturnVal.ToString())Specified argument was out of the range of valid values. Parameter name: index
Access database: Inventory
Column 1: Pprice
Column 2: Date
Now what I want to do is on a button click, I want to search the database for a date range, lets say September/01/2010 thru September/30/2010. Then I want to pull all of the Pprice values and add them together to come up with an inventory parts cost for the month.
I've mainly been recording keystrok macros... I created visual basic code that allows the user of a template to hide table gridlines - which works fine. The code to show gridlines does not work if the table has only one row. Here is the code - it is getting "stuck" on the
.LineWidth = wd
LineWidth050pt for a horizontal border, as there isn't one. I don't know how to change the code to not execute the command if a horizontal border line does not exist.
With Selection.tables(1)
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = 5592405
[Code] .....
I have been working lately on a program who extracts URl Source codes!The program does work with most of URL but not for MEdiafire URL!When i check the source code from the web browser i can see there is some code missing;y tried diferrent types of Encoding.
Example:This is the final source code extracted from WEBBROWSER(Firefox,InternetExplorer,GoogleCrome)
--------------------------------------------------------------------------------------------
<div class="mf_lightbox_btns lb-footer" style="text-align: right;">
<a href="javascript:void(0);" class="secondary btn" onclick="$('body').removeClass('has-virus'); return false;">Dismiss Message</a>
<a href="http:www.bitdefender.com/mediafire/fix-it.html" target="_blank" class="alt btn">Get BitDefender</a>
[code]....
Per this UserControl that can be added to a blank form, I would like to use the HorizUnits array below to map custom grid x coordinate from a mouse x position.For a given input value 13, what syntax would I use to obtain a value of 2 where 13 lies between Value 10 and 16 for which 2 (Name) would be the custom grid's displayed coordinate position?
View 1 RepliesIm 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
I am trying to copy the values to another sheet but not in any sequence eg.A1,B2,C4,D7 ........and so on. I am trying this slick way of doing it by the code below ( found on the web) without success so far but I got a feeling I am close to the solution. I am new to any kind of Programming. This is my first attempt. (so a chuckle or two is ok after seeing my "difficult" problem)
(This is an excel VBA Prblem)
Sub justdoit()
Dim s As Variant
[code].....
I am using the following code in the Load method of a VB form to generate random numbers in the range 1 to 8. Without fail after enough loops the range is exceeded and 9 is the random number returned every time. The line using the Rnd function is from: Rnd Function (Visual Basic)
[Code]...
Below is my code, but when i send the message thru client socket i receive Specified argument was out of the range of valid values. Parameter name: size
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim serverStream As NetworkStream = clientSocket.GetStream()
Dim outStream As Byte() = _
System.Text.Encoding.ASCII.GetBytes("0800822000000000000004000000000000000920092126012345001")
[CODE]...
I am getting the error:"Range variable 'sender' hides a variable in an enclosing block or a range variable previously defined in the query expression."for this
Imports System.Data.SqlClient
Imports System.Linq
Public Class Form1
[code]....
I can select any other item from the table without the error. "sender" has the same properties as "receiver" in the SQL table.
I'm using vb in excel 2007 and need to work through a range or array, the size of which varies from time to time.
The examples of using range always demonstrate using literals eg "A1:A25"
How can I programatically determine the end of the range - ie up to where the cells value is blank
And then can I use a variable in the range statement - eg .[A1:Lastcell]
I have the following code to extract the last name from any given name, but i aint getting it right. Pl help.
Dim i, l As Integer
Dim it2 As String
it2 = ""
i = 1
[code]....
I've been having problems extracting the value of a Regex in a String. I have a string with several regex expressions and I need to get the value of each expression's match. The thing is though, it's not returning the last match correctly. For example:
Regex Pattern: I play (S+.*?) and (S+.*?)
String: I play the guitar and the bass The program is returning the value of the first expression as "the guitar" but it's returning the value of the second expression as "the" instead of "the bass".
I have a string that looks like this:
var expression = @"Args("token1") + Args("token2")";
I want to retrieve a collection of strings that are enclosed in Args("") in the expression.
How would I do this in C# or VB.NET?
Does anyone know of a way that you can get the string that is held at this reference point (its the contents of a registry value that corresponds to a string - see this thread for more info [URL]
@%Systemroot%system32wbemwmisvc.dll,-204
I think I've seen C# (or maybe C++) code use lines like this but I cant find any way of getting the value from the DLL in VB.NET
I am trying to test bit 7 (87654321) in the byte DB2 to check if its true. The below code does not seem to be working:
If DB2 And &H40 = &H40 Then Label1.Visible = True
If DB2 And &H40 = &H0 Then Label1.Visible = False
TextBox6.Text = Hex(DB2 and &h40)
I do see the value of DB2 changing from &h00 to &h40 in the textbox, but when evaluating in the two if statements, it never evaluates to true (for testing, the only possible values for DB2 right now are &h00 and &h40)
I have two collections that I am comparing to a thrid collection. Both collections have 147 values in them. I am wondering how I get the results of the comparisons in a text document concatinated to look like this:
Output from Collection A Comparison
Collection B results
Repeat the above two line until all results have been written to the text file. Currently the program runs and the document is not created. Here is the code:
Dim sb As New System.Text.StringBuilder
Dim ordersCount As Integer = &H3E8
Dim i As Integer
[Code]......
I realize this may be a simple request, but I am fairly new to VB so even the simplest tasks are sometimes over my head. Basically, what I need is a function that will take a URL from one of the text boxes on my form, and extract a certain piece of text from that URL. The problem, for me, lies in the fact that the text in question isn't always in the same position, character wise, every time. Basically, the URL looks something like this:
url...randomNumbers rarely seems to be the same amount of characters each time, however the randomNumbersINeed always appear after the second underscore and end right before the third underscore, no matter the amount of randonNumbers that appears before hand.The process I am working on does the following:
1. Takes the raw URL that I have pasted into a text box on the form.
2. Declares that text as a string.
3. Extracts randomNumbersINeed from that string
4. Assigns or declares randomNumbersINeed as a string
5. Appends that string to a .txt file.
I can do steps 1, 2, 4, and 5 with no problem, in fact I've already got those set up in my code ready to go. I just need a function that could extract the numbers from the URL.Could someone help me out here or point me in the right direction?
i want to store 2 files in the program and the user clicks the button a dialog shows and the user go to the directory he wants to add these 2 files that stored in the program, How to Do This??
View 8 RepliesI want to know how to create a microsoft self-extracting cabinet exe file.
View 4 Replies