Dear Areesh Kumar S
If you are new on the topic of programming then it is good to start with learning writing Algorithms (just google for "learning algorithms".
This is a method to see with blocks how a problem comes to a solution in a computer language .
Mostly with questions and statements like "IF .... then... else.....
Second is the language itself.
Then you have to learn the syntax of the code...
User Profile
Collapse
-
Split the text on "vbnewline" in an array.
Run through the lines and isolate those who have the value.
See also attachment
Code:'§ Text1= original text '§ Text2= isolated Text '§ TextIsolate has the value for the condition '§ (VALUE if isolating on the value of the string) '§ (LENGTH if isolating on the length of the string) '§ ComSplit isolates the text '§ ComClear
Leave a comment:
-
Sorry, my mistake.
For the last records there is an error in the code.
There is 2 times "Case 3" so If there are 4 records left, the 4th will never be seen.
It must be:
Code:..... Case 3 .INDEX3 = ARRSELidx [B]Case 4[/B] .INDEX4 = ARRSELidx End Select End With .....
Leave a comment:
-
-
You set the i = lstBalance.List Count !
Where when you add the first item, the count=0 !! (empty list)
so:
i=0
lstBalance.AddI tem "0" & i & " - " & X
gives: 00
The index for the next add must be: listcount +1
Code:If i > 0 And i < 10 Then lstBalance.AddItem "0" & i+1 & " - " & X Else
Leave a comment:
-
How do you add the values to the Listbox?
Value after value with a counter like:
Code:Private Sub Command1_Click() Dim i As Integer For i = 1 To 20 If i < 10 Then List1.AddItem "0" & i & " - " & i * 10 & "$" Else List1.AddItem i & " - " & i * 10 & "$" End If Next End Sub
Leave a comment:
-
This is a solution if you work with DirListBox and FileListBox:
Code:Private Sub Dirs_Change() '§ put the filelist on the selected dirlist On Error GoTo NO_FOLDER Files.Path = Dirs.Path '§ filter according to the text in the textbox like: ".mp3" Files.Pattern = filter.Text Exit Sub NO_FOLDER: MsgBox ("There is an error on reading the folder") End Sub
Leave a comment:
-
Are you using a FileListBox or a TextBox ?
Is it possible to attach your code in Bytes?Leave a comment:
-
The code seems to be OK but in the URL pages there is no "displayEma il =:" on which you want to capt the data from.
PS: be carefully with names: there is also a macro with the same name as the named-range: "URLdata"
I have attached a code in which you can see the data of the URLs for 5 seconds.
If you want a longer time, change the 5 to a higher value....Leave a comment:
-
Killer42,
I don't think twips-per-pixel depends on screen.
The definition of twips in the help of VB:
"A screen-independent unit used to ensure that placement and proportion of screen elements in your screen application are the same on all display systems. ..."
But yes, it's better to work with "3-Pixel" as scalemode in the form settings.Leave a comment:
-
Guido Geurs replied to MS Chart Control 6.0 - possibility of removal of left and bottom Margin of the chart.in Visual BasicYou can move the graph rectangle with:
Code:Private Sub Command1_Click() With MSChart1 .Enabled = True .Plot.LocationRect.Min.X = -60 .Plot.LocationRect.Min.Y = -135 End With End Sub
Leave a comment:
-
First of all: a pixel is 15 twip.
So if you want to work on the precise pixel, you have to use a multiple of 15 like :
480 or 505 for the form
90 or 105 for top and left
390 or 405 for the textbox.
Also don't forget to set the border of the form to NONE , the Controlbox to false and nothing in the Caption.Leave a comment:
-
A little rectification:
No need to transfer the image to the picture element: you can also directly print the image with:
Code:SavePicture Picture2.Image, App.Path & "\test__" & Replace(Replace(Now, "/", "-"), ":", "+") & ".jpg"
Leave a comment:
-
Even if Autoredraw is set to True, it will not change the way of how Pset is working.
The Picture2.Pictur e is a background in the picturebox like you can put a picture in the background of a form.
The command Pset DRAWS a new gray point on top of the background = not in the background but in an "image" in the picturebox.
If you analise the structure of a picturebox than you will see a picture...Leave a comment:
-
See help vb:
"PSet = Sets a point on an object to a specified color"
With your code you are drawing a POINT on top of the picture in the picturebox with a color-value = the grayvalue of the underlying pixel of the picture in the picturebox!
You have to change the color of the pixel in the picture in the picturebox !Leave a comment:
-
The problem is in the code to change to gray: the picture in the picturebox is not changed !
Add a image in the form and add the code after the gray change=
Code:Image1.Picture = Picture2.Picture
Leave a comment:
-
There are some conditions for working with array in functions.
The array's must have the same datatype,...
This is a good site with examples for working with array:
http://www.cpearson.com/excel/passin...ningarrays.htm...Leave a comment:
-
Is it possible to attach your vb codes in bytes? (go to "adavced" * "additional options" - "manage attachments", ...)
there are some irregularities:
- select case: ???
Code:Select Case True Case q2 = 0
Code:Select Case q2 Case 0
Code:MsgBox ("Your score is " & q1 + q2 + q3), vbExclamation + vbOKOnly, "Congrats" End
Leave a comment:
-
is the value in "strArtistStrin g" OK?
Because iLoc = InStr("Eeny, Meeny, Miny, Moe", "Moe")
gives me iLoc= 20
PS: no need to use the 1 in Instr(1,...) when you start at the first letter !Leave a comment:
-
these are some examples how you can load a file:
1) IF you want to select a file:
Code:Private Function Open_File() Dim STRTEMP As String TextBox.Text = "" On Error GoTo Cancel_Function With CommonDialog .CancelError = True .Filter = "Text (.txt)|*.txt" .InitDir = Environ$("USERPROFILE") & "\My Documents"
Leave a comment:
No activity results to display
Show More
Leave a comment: