Hi There,
Is it possible to add multiple listbox items into a single array? The code below works for a single Listbox1, how do I add a second Listbox to the end of the first array, e.g. Listbox1
Private Sub CmdOk_Click()
Dim myArray() As String
Dim Count As Integer, i As Integer, j As Integer...
Hi there, I have a form which has a number of checkboxes. Is it possible to capture and store the order in which the checkboxes were selected in an array?
So if there are 20 checkboxes and the user selects CheckBox1, CheckBox3, Checkbox18, I want to capture the Control.Value (which I assume is...
Hi all,
Have a number which can be a 1 or more digits. Max number has thousands separator
Trying to work out a regex to match any of these:
'345' -match '(\d{1,})'
"Number is $($matches[1])"
Works for single digit and 3 digit numbers
and
'3,345' -match '(\d{1}\,\d{1,3})'
works for 4...
Trying to use VBA to create a table using bookmarks in Word 2010 from a Userform with 2 columns and row based on number of checkboxes ticked. Then populate just the first column with predefined text and the row number
The second column, would contain the Caption or name of the checkbox. I...
Hi there,
If I have a Hash of Arrays, how to you find out if a value exists for a given key.
use Data::Dumper;
#populate hash
foreach (1 .. 4) {
push @{ $hash{key1} }, $_;
}
foreach (5 .. 9) {
push @{ $hash{key2} }, $_;
}
So if I wanted to find out if '1' exists in key1, how do I...
Hi There,
I have the following code to import a csv file into Excel:
Sub ImportCSV()
Dim vPath As Variant
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet
Set wb = Excel.ActiveWorkbook
Set ws = Excel.ActiveSheet
vPath = Application.GetOpenFilename("CSV (Comma Delimited) (*.csv),*.csv" _...
I have an array of integers and the array size is variable ,it is determined at processing time.
What I need to do is to work out how many elements there are in the array and process each element with no more than 50 at a time.
So, if there are 320 elements, then I need to process them in 6...
Using Data::Dumper module I can see an empty hash element, in this case $VAR1/$VAR2
$VAR1 = '';
$VAR2 = {};
$VAR3 = '5';
$VAR4 = '7';
etc
How do I check and remove empty hash elements? Do I use undef?
Have some data like the following
Product : CCS
SerialNumber : 75010010
LUs : 2
iLU HDevName OSPathID PathID ChaPort Status Type
0026 hdisk24 00000 000018 1A Online Non
00001 000019 0A Online Own
0148 hdisk29 00000 000020...
Have simple piece of code
$string = "1234";
@val = join(':',split(//,$string,2));
print @val;
__RESULT__
1:234
How can I get the result like 12:34 instead using the join function?
Is the only way to do this?
@val = split (//,$string);
print $val[0].$val[1].":".$val[2].$val[3];
All tried performing a regex over multi-line text like so
while (<DATA>){
print "$1\t$2" if /Name=(.+)Work=(.+)/s;
}
__DATA__
Name=Paul
Phone=555-555-555
DOB=09/09/08
License=456332
Work=Doctor
.....loop through list
Data has spaces at the beginning...
I run a command which has the following results from STDOUT:
Serial=102345
Name=Server1
Type=Windows
....
Serial=345069
Name=Server2
Type=Linux
...
etc
How do I place each combo of serial and type into a hash for easy reference
my %hash;
my @cmd = `command`;
foreach $line(@cmd) {...
Hi there,
Have a simple script which runs a command on the system and returns the regex value
my @val = `command here`;
foreach $line(@val) {
if ($line =~ /(test\d+)/){
print "$1\n";
}
}
The question is, I only want to print...
Have script which parses a CSV file which looks like the following
Date and Time Number Total I/O /sec More columns
08 09 2007 18:00:00 00:00 2.2733333
08 09 2007 18:00:00 00:01 0.033333335
08 09 2007 18:00:00 00:02 0.036666665
08 09 2007 18:00:00 00:03 1.1433333
08 09 2007 18:00:00...
I've got a set of data in a text file which looks like the following:
Data1 Data2 Data3
0 0 23
0 1 0
0 2 3
...
1 0 45
1 1 23
1 2 0
The number of rows is totally variable
There are 2 halves...
Hi all,
I'm trying to build a regex which will allow me to search a text file between sections
So the data looks like this, the data begins after
Data1 Data2 Data3 and ends when the next line is:
Data4 Data5 Data6
---- Section 2 ----
Data1 Data2 Data3
0 0 30
0 1 0
0 2...
Hi all,
I'm trying to search a text file for 2 values using regex and format the output so that the values are side by side in a tab delimited format
Text file looks like this. 'Val' is constant, but the number after Val will be different
----------------------------
Value Val 1
.
.
more...
Have a text file which looks like the following:
txt1 1001
txt1 1002
txt1 1003
txt1 1004
txt2 1005
txt2 1006
txt2 1007
txt2 1008
txt2 1009
txt3 1010
txt3 1011
txt3 1012
etc
Each block can have different number of lines
I want to be able to loop through each line of...
All,
Trying to take variables from the command line and using modulus to check that all variables are either all odd or all even.
example of all even numbers might be
var1 = 10 var2 = 0 var3 = 4
example of all odd numbers might be
var1 = 11 var2 = 1 var3 = 3
So code to check for odd is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.