Questions tagged [vba6]

Visual Basic for Applications (VBA) is an event-driven, object-oriented programming language for writing macros, used for the MS Office suite as well as other applications. VBA is not equivalent to VBA6, VBA7, VB.NET, or VBS. If your question is specifically about programming any MS Office application, also use the appropriate tag: [excel], [ms-access], [ms-word], [outlook], [powerpoint] or [ms-project].

Visual Basic for Applications (VBA) is an event-driven programming language which was first introduced by Microsoft in 1993 to give Excel 5.0 a more robust object-oriented language for writing macros and automating the use of Excel. The language and its runtime quickly matured and began being used in products beyond Microsoft Office applications.

Differences between VBA 6.0 and VBA 7.0?

There's not a whole lot that has changed between VBA6 and VBA7. VBA7 was introduced to support 64-bit versions of both Office and Windows while VBA6 only supports the 32-bit versions of Office.

Reference

Differences between VBA 6.0 and VBA 7.0

139 questions
2
votes
1 answer

How to pass Range to VBA Basic Function for NPV formula

I am trying to simplify the NPV function for PV0. The existing formula discounts the first number in the array, so to find the true NPV, you have to do "=NPV(rate, B2:B6) + A1" if: [ Here is my code: Function True_NPV(rate, PV0, CF_Series As…
2
votes
0 answers

Subscript out of range how to solve it

I'm trying to activate a certain sheet in my workbook but I still get the same error 9 "Subscript out of range" when trying to run it from the userform. When I use Debug fuction, it says that "materialWorksheet = Nothing" Private Sub…
2
votes
4 answers

Remove special characters from range in VBA

I have created a VBA code to remove all special characters available in a column. As an example I have a Alphanumeric character with some special characters in every cells of a column: Suppose in a cell I have a value: abc@123!-245 After executing…
Shaon Paul
  • 153
  • 1
  • 2
  • 14
2
votes
2 answers

Fix BOM issues when reading UTF-8 encoded CSVs with VBA ()

I'd like to get fresh advice on the infamous issue caused by the Byte Order Mark ( or EF BB BF in hex) when trying to read UTF-8 encoded CSVs with VBA (Excel). Note that I'd like to avoid opening the CSV with Workbooks.Open or FileSystemObject.…
Lo Bellin
  • 485
  • 4
  • 20
2
votes
2 answers

Match any character except '

I want to match any character (case insensitive) except when preceded by a single quote followed by the text On Error Goto: Match: on error goto err_handler if aap = 0 then on error goto Myerrorhandler on error goto errorhandler1 on error…
Guus
  • 53
  • 3
2
votes
0 answers

Is this pointer type watertight?

I'm trying to design a custom type that can be used in APIs which need window handles or other kinds of pointers, and which will work for all systems VBA can run on. Here's what I've got: #If (Win64 = 1) And (VBA7 = 0) Then Public Type LongLong…
Greedo
  • 4,967
  • 2
  • 30
  • 78
2
votes
1 answer

Is it possible to globally add a project reference to anything that opens in Microsoft Office 2016?

I have a Microsoft Access Application (.mdb) that is old and proprietary and needs to be run on Windows 10 in Microsoft Office 2016. The frontend (.mde) for it needs some old .ocx controls, and I've narrowed it down to it needing a library (link1,…
leeand00
  • 25,510
  • 39
  • 140
  • 297
1
vote
1 answer

GET value from web table

based this code i need to get also the link value from each row in table. Actually i get only PR and PROVINCIA reference link: https://www.comuniecitta.it/sigle-province-italiane for example of first row i…
user1579247
  • 107
  • 1
  • 6
1
vote
1 answer

copy file from a folder to another knowing the file name typed in a text box

I am trying to create a code to copy a pdf file from a folder to another folder keeping same name and everything. when I type the file name in a textbox and click on a button I want the code to copy this file from a folder to another. my code is…
1
vote
2 answers

How to add more than 200+ values in my VBA code?

m trying to use one VBA code which filters the city and paste the data accordingly in another sheet with reference to some column names M trying to make a long list in array but it not taking a value more than 35, below is the mentioned code Sub…
1
vote
1 answer

Sort data in VBA doesn't execute

I tried to copy the worksheet RLDSht in the first workbook in to my 2nd workbook. Then it's called USSht worksheet. I want to sort data in this USSht but it doesn't execute even when I Activate the worksheet. Here is the code: Public WorkbookName As…
1
vote
1 answer

AutoFill textbox on userform with exact value

I want to auto fill two textboxes on my userform ,from a data of a sheet i have, but i want the code to find with the exact value and not just one part of it. Ex: if i put the number "33" it returns a value, when the column have like "202409334", i…
1
vote
0 answers

I want to copy filtered cell from excel VBA

I'm just learning VBA and I wanted to know cause i made some code for copying down from excel sheet that have been filtered but are still not able to do it Sub Compile_SKU_Inventory_Summary() Application.ScreenUpdating = False …
1
vote
2 answers

How to Find how many Letters does a Text Box's value has in VBA?

I Wish there is a way to get the amount of the characters of a Text Box Value so I can limit it to be the amount that I wanted. so like when someone entered 134131323 as the Year of Date, I can limit it to 4 characters. Also I the programming…
Aydiniyom
  • 13
  • 4
1
vote
2 answers

Array that consists of numbers from 1 to 8 randomly in 8 rows and 8 columns, that doesn't repeat each rows and columns

Basically, I want to create cross check inspections among 8 staffs randomly every month from January to July, The Purpose are in which each staff will not inspect the same other staff and will not inspect themself. Those 8 staffs data will be…
1
2 3
9 10