Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

Visual Basic Classic

163K

Solutions

58K

Contributors

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

Share tech news, updates, or what's on your mind.

Sign up to Post

Although I have been working with Excel for some time, I am still having issues with the arrays.
I would like to create a procedure that copys date from a range (based on two dates values) into an array and then into another worksheet.

So the array to populate is called arrOutput and is of a custom type.  

'Custom Types
Type tPickupOutput
    PickupID                        As Variant
    PickupDate                      As Date
    Name                            As String
    Street                          As String
    StreetNumber                    As String
    City                            As String
End Type


Sub CopyDates(DateFrom As Date, DateTo As Date)
Dim arrPickups()        As Variant
Dim arrCustomers()      As Variant
Dim arrOutput()         As tPickupOutput
Dim CustomerID          As Integer


Dim count               As Long
count = 0

arrPickups = Range("RecyclingTaxiAufträge")
arrCustomers = Range("Kunden")


'count how many items to add to the array
For X = 1 To UBound(arrPickups)
    If arrPickups(X, 2) >= DateFrom And arrPickups(X, 2) <= DateTo Then
        count = count + 1
    End If
Next

ReDim arrOutput(0 To count) As tPickupOutput                 'Public array

For X = 1 To UBound(arrPickups)
        If arrPickups(X, 2) >= DateFrom And arrPickups(X, 2) <= DateTo Then
            arrOutput(X).PickupID = arrPickups(X, 1)
            CustomerID = arrPickups(X, 3)
            arrOutput(X).Name = LookupCustomer(CustomerID, CustomerName)
  

Open in new window

0
Concerto's Cloud Advisory Services
LVL 5
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Hi,

I'm looking to extract the script of multiple web pages using VBA and paste it on an a current excel sheet. The URLs of these web pages will be fixed. My end product is the hyperlink URLs within these web pages. These hyperlinks will be updated from time to time, so I'm looking to automate the extraction of the script of the web pages. I already have the code to filter the specific hyperlinks I need from the entire webpage script. I'm using IE for this.  I have basic VBA knowledge so hoping you're able to suggest a code for this and be explicit in explanations! Thank you
0
Hi All,

I am looking for either code or a control, which operates in a manner similar to the combo next to the label "Look In" in the image below:

Look in
I am aware of an currently use the BrowseForFolder type control, but its not exactly ideal - my preference is for a combobox that throws out a treeview controlwith the directories listed in the same manner ...

MTIA

DWE
0
Hello,

Please see the attached sample file.  The existing code works which splits out rows into separate workbooks based on an ID in column C.  Part of this code looks at specific IDs and if found groups them together and places them in new workbooks.

I am seeking assistance on modifying the code so that it also does the following:

  • Create a new workbook called JN9 if the number in column C begins with 007 and 000037 (all in one book) but excludes 007005 which should be left to run for the bulk of the primary code.  
  • Create a new workbook if the number in column C begins with 14 called IC1
  • Create a new workbook if the number in column C begins with 13 called IF1
  • Create a new workbook if the number in column C begins with 12 called S1
  • Create a new workbook if the name in column K has Franklin, Ben, Carter, Jimmy, or Clinton, Bill called Org1

These 'exceptions' should be identified first before the primary code runs so the appropriate workbooks are built.

Any assistance would be greatly appreciated.

Thanks!
EE-Test-File-V4-Most-Recent-EE-File.xlsm
0
field will be in the form are as follows
GIN--STATIONARY NO
GX NO. CG/001/N - AUTOMATIC CHANGEABLE AFTER EACH
DATE - CHANGEABLE
DOO- DATE I WILL DECIDE
SUR NAME- FROM TABLE
INITIAL-FROM TABLE
RANK-STATIONARY FOR EACH PERSON
P. NO.-UNIQUE NO
THERE WILL BE SOME CASUALTY e.g. LEAVE, MOVEMENT, PROMOTION,AMENDMENT
i donot have the idea how to make this form from the so that i can receive the date from table. ple help me.
0
There are plenty of macros for finding and deleting lines but I wish to go in my Word doc to a specific line (that will always start with "JA:" and delete all full-stops in that line, and repeat until all full-stops in all lines starting with "JA:" have been deleted. Thanks!
0
Does anybody know how to unlock a Microsoft Visual Basic solution with Windows Git... All of the files inside of the solution are currently checked in and are in read only. I am able to edit the source code, however when I debug the solution I cannot add any input, click on any buttons, open up any menus, or execute any other events on the Windows Forms. The solution is currently saved on a remote server, but when I clone the repository to a local server it does not allow me to work with the forms in Microsoft Visual Studio 2017. Here is a link with the problem I am having below. I am unable to manually checkout the files. I have created a new branch from the master branch and checked out the branch with a new name I made with Git, however it is still not unlocking the solution unfortunately... If anybody has the solution to this problem it would be much appreciated and I will keep working to try to solve the issue.

https://docs.microsoft.com/en-us/vsts/tfvc/check-out-edit-files

Christopher
0
Hello,

I have to implement in a web service header the oasis usernametoken security.

I have seen some documentation that implement it using Microsoft.Web.Services3, but in VB 2005.

What is the Equivalent of Microsoft.Web.Services3 in VB 2015?, are there any example on how to implemented this type of security in VB 2015?
0
Hi,
lately I moved to OLAP based pivots as that seemed to avoid the nuisance of destroying pivots on input range/table data column name changes. Seemed to work well for page, row and column fields (what a relief!). For value fields (represented  internally by [Measures] cubefields however it seems to be more tricky. The [Measures] seems to get updated on the name change, e.g. from
[Measures].[Count of oldName] to [Measures].[Count of newName], but the Orientations gets set to xlHidden (not shown in the pivot). Any idea on how to fix/avoid that?

Looks like in some cases just setting the orientation back to xlDataField had no effect (without any error message), just readdding the Value field seems to work consistently. But as the xlHidden state for any such measures can have multiple reasons (not just the name change), it will be tricky to solve this issue programmatically with a catch all macro that acts on all xlHidden [Measures] cubefields.
0

Visual Basic Classic

163K

Solutions

58K

Contributors

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.