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
1
vote
1 answer

VBA Type Mismatch Issue

Sub Delete_Specific_Columns() Dim sh As Worksheet Set sh = ActiveSheet sh.Columns("B:D,I:AZ,BC:BJ,BO:EQ").Delete End Sub Keep getting a type mismatch error.
1
vote
2 answers

How to prevent user from saving changes to a master Excel file?

I maintain a master Excel file used by a team. I keep an original of this file as a backup, and I put a copy in the team folder. Sometimes a team member opens this file in the team folder, make changes, and accidentally save the changes. That…
1
vote
1 answer

i would like to replace excel code to VBA format

=IF(AY2=AX2,AW2,""). Can any please help me how to write theb above formula in excel VBA. I have already copied this formula in VBA, but the output shows '1004' error, I have already copied this formula in VBA, but the output shows '1004' error,
pavan sai
  • 11
  • 1
1
vote
2 answers

Convert ppt to pdf and protect the file

The below is the line of code I'm using it currently which converts ppt to pdf, however I want to protect pdf , Is there any possibility PowerPointapp.ActivePresentation.SaveAs path & pdffileNm & ".pdf", 32
NishuSruj
  • 41
  • 4
1
vote
1 answer

How to copy specific columns and filtered rows into another worksheet

Please, I need some help with my code. I filtered some rows using VBA and would like to copy only two columns instead of all columns. Public Sub CheckPrKey() lastRow = Worksheets("ETM_ACS2").Range("A" & Rows.Count).End(xlUp).Row For r = 2 To…
Jyde
  • 17
  • 4
1
vote
0 answers

Run/Show VBA form from Inventor Ribbon

I have created a form using Autodesk Inventor VBA with buttons for different functions Button one add op runs a rule that prompts the user to make selections from arraylists which creates custom iproperties. Button two fills the form with the custom…
Brent
  • 31
  • 3
1
vote
5 answers

How to sort outline numbers in "numerical" order?

For instance, I would like these 6 numbers. Currently when I use the sort method it puts 6.6.1.1.13 first and 6.6.1.1.2 later. Before Sort 6.6.1.1 6.6.1.1.1 6.6.1.1.13 6.6.11.14 ► 6.6.1.1.2 What I Want It To Look Like After Sort 6.6.1.1 …
Punar
  • 21
  • 4
1
vote
1 answer

VBA Code Error "Invalid or unqualified reference"

I am very new to vba coding . In the worksheet I am trying to add an additional column using macros-column (Q)by checking conditions in simultaneous columns J,K,O).So if certain conditions pass in each of the columns I want a value to be entered in…
Archa
  • 21
  • 2
1
vote
0 answers

What was the last common common ancestor of VBA6 and VB6?

I've read Difference between Visual Basic 6.0 and VBA What are the differences between VBA 6.0 and VBA 7.0? ... neither of them is quite what I'm getting at. I know VB6 and modern day VBA 7 once had a common ancestor for both syntax (i.e. code…
Greedo
  • 4,967
  • 2
  • 30
  • 78
1
vote
1 answer

Get the last deactivated worksheet

Private Sub Worksheet_Deactivate() Msgbox(worksheet.Name) End Sub How can I get the last deactivated Sheet once I press on any sheet other than the sheet of interest.
1
vote
1 answer

Macro : Open Latest File in Folder and Copy Paste Below Last Cell

How can i combine these two parts of code in Excel VBA? Part 1: Sub Copypastelastrow() Dim MyPath As String Dim MyFile As String Dim LatestFile As String Dim LatestDate As Date Dim LMD As Date Dim LMD As Variant Dim…
Andrew
  • 13
  • 2
1
vote
2 answers

Why does VBA For Next Loop calculation incorrect?{VBA}

I am new to VBA - trying to do a simple calculation using VBA but not able to make it work properly. Any help will be highly appreciated. Basically I have a row, the result should be equal to the previous result + current according cell This is what…
Silin Deng
  • 15
  • 2
1
vote
1 answer

VBA How To Loop Through JSON response from WinHttp.WinHttpRequest

I can't figure out how to properly loop through a JSON(Object) response from the WinHttp.WinHttpRequest that I am getting. Below are the References being used. I prefer to just keep it as is and use WinHttpRequest Dim response As Object '…
heisenberg
  • 1,784
  • 4
  • 33
  • 62
1
vote
1 answer

Advice about Arabic characters using VBA

I'm working to send Emails to each student containing ( student name and his marks ) from excel sheet as shown below Everything working fine, But when the student name is in Arabic char. the name shows as ( ???? ) as you can see below I changed…
Tariq
  • 101
  • 1
  • 1
  • 10
1
vote
1 answer

Outlook VBA script to save all attachments in an Inbox subfolder

I am trying to modify this VBA code to save all attachments from emails in an Inbox subfolder. Items populates with all the messages in this folder but the rest of the code is not working. I am trying to print out the item object to debug and that…
Austin
  • 11
  • 4
1
2
3
9 10