Visual Basic for Applications (VBA) is an event-driven, object-oriented programming language for writing macros, used for the entire Office suite. If your question is specifically about programming Excel, Access, Word or Outlook, use the appropriate tag: excel-vba, access-vba, word-vba or ...

learn more… | top users | synonyms (1)

0
votes
0answers
4 views

Find original scale of Powerpoint VBA msoLinkedPicture

I have a routine that update all links in a PowerPoint presentation. However, if the images that comprise the links have been resized, they will come in at a the same size, which will distort them. I ...
0
votes
0answers
13 views

VBA unable to extract HTML tag information for intranet website

I wrote a VBA code in which I navigate to one of our intranet websites, input a value in a search field and fire the event triggered by the search button. The problem is, I am unable to get any ...
0
votes
3answers
20 views

VBA, search in column for specific character, extract string upto that character

In a specific column, I want to search for a specific character in cells...say "(" or "/". Once this character is found in a cell, I want to extract the part from the beginning of the string upto the ...
1
vote
2answers
16 views

object required error for if statement visual basic

I want to set up a code in VBA to identify any cells in a range which are not numberic (e.g #NUM!) and replace it with a statement. For all cells which contain a number I want to keep the value of ...
0
votes
0answers
8 views

VBA Automatically Saving incoming emails from outlook

I am trying to write a small macro program for outlook. The Program Should automatically save the text of incoming emails as a text file. I found large pieces of code and tried to make this work but ...
-2
votes
0answers
11 views

Best Scale for Slideshow option ppt through vba

I have a code that copies many charts as images from excel 2010 to ppt 2010. I'd like to know how to make vba (run from excel) activate the "Format Picture> Size> Scale> Best scale for slideshow" ppt ...
0
votes
1answer
11 views

Update Query VBA Access

I am wanting to copy information from the Id column in the Products table to ProductsId column in another table using vba/sql in Microsoft Access. I was just wondering how I would be able to do this. ...
0
votes
2answers
14 views

Excel - Inserting formula with VBA

Hello Stackoverflow friends, I am struggling for 1 hour with a formula I would like to insert via VBA: Formula = "=IFERROR(VLOOKUP(Q" & j & ";Table1[#All];2;FALSE);"""")" ...
0
votes
5answers
17 views

PivotTableChange Event

I am having trouble finding a way to capture any changes within a specific worksheet, within a specific pivot table. The Pivot is "pivottable6" The Worksheet is "APAC" I have placed this code within ...
0
votes
0answers
10 views

populate values in to two textboxes from a single userform

I am writing a code in Ms-Word vba. I made two userform say userform_1 and userform_2 in which one is a calendar userform i.e. userform_2. I have two buttons and two textboxes in my userform_1. I ...
0
votes
0answers
5 views

Combine 2 field information to 1 field with VBA Access 2007

I use access 2007 I have 1 table wich is called 'Planning' In this table is a field called 'history'. In this field (Memofield) I keep track of all things that are happened to 1 item. I also have a ...
0
votes
2answers
24 views

VBA Decimal point from float value in a Cell is automatically discarded

I have a variable with float value i.e. Dim H_reqquant As Double 'Its value is 10.5 But when I get this value in VBA like this: H_reqquant = Worksheets("Data").Cells(3, 8).value It is converted ...
0
votes
4answers
19 views

Subscript out of range VBA Excel

Dear Stackoverflow friends, I keep getting an error here which is driving me crazy. Run-time error '9' Subscript out of range Here is the code: Sub UpdateIt() 'Clean ...
2
votes
2answers
28 views

VBA on Excel only use one processor, how can I use more?

VBA is known to work on only one processor at the same time, so when I run a macro, Excel only use 50% of CPU instead of totally (dual-core). Is there a workaround to make VBA use both processors ? ...
1
vote
1answer
12 views

Insert picture to Excel VBA, method Pictures failed

Tried to make a macro that progressively inserts 3 images in Excel One worksheet (pics) contains the URLs of images in Column A row 1-3 The other worksheet (outputs) is supposed to output the images ...
0
votes
1answer
15 views

InputBox text not displayed in cell

Here is my code Private Sub Worksheet_Change(ByVal Target As Range) Dim vrange As Range, cell As Range Dim TheAnswer$ Set vrange = Range("J1:J503") If Intersect(vrange, Target) Is Nothing Then ...
0
votes
1answer
26 views

MySQL Recordset Not Returning Values When it Should

I'm trying to retrieve a recordset from MySQL through VBA (in Excel) using ADODB. I can successfully connect to the MySQL database over the network and can even return a list of the tables using ...
0
votes
1answer
9 views

Referencing Controls on main form and a form opened from the main form

I have 2 forms. The first one, in _Load executes several statements such as the one below, storing control references in arrays. Set dateButtonsArray(1) = Forms("DepositsForm").[Date1] Through an ...
0
votes
1answer
35 views

Excel VBA do while function to return a value to a cell won't work

I'm trying to use Excel VBA to generate two numbers. Between one and 11. If the numbers are equal, then the second one should re-generate from random. If the first one is 8 or 9, then the second one ...
-1
votes
0answers
24 views

Anybody able to fix this? if .. then (VBScript) [duplicate]

Basically I'm making a VBScript which alerts me if an item is found (certain items) on a website Id=114613970 Do WScript.Sleep 1100 frame.Visible = True frame.Navigate ...
-1
votes
2answers
37 views

excel VBA trying to get my macro to run faster [closed]

I am trying to get my macro to run a bit faster and i was wondering which way is the fastest: 1) Set cell2 = Range("F" & CurrentRow) Set Columns = Range(cell2, cell2.Offset(0, LastColumn - 6)) i ...
0
votes
1answer
22 views

Ms Access form control calculate value based on time of day

I have a combo box [cboShift] that has two selections "Daylight" and "Afternoon". What I want to do is I want it to auto select what shift im on based on what time it is. So if the current time is ...
0
votes
0answers
27 views

Excel: Search multiple sheets and copy rows containing criteria to new worksheet

I've finally had to throw the towel in and seek help. This question seems to have been asked time and time again but with slight variations. Despite this i have struggled for over a week to try and ...
1
vote
1answer
28 views

Concatenate string and integer in VB

I have a following code: Dim IDfiltr As Long IDfiltr = Forms!KONTROLA!ID_OS DoCmd.OpenForm "OSOBA", acNormal, "", "", , acNormal Forms!OSOBA.FilterOn = False DoCmd.ApplyFilter "", ...
0
votes
1answer
20 views

How to center all tables in Word, coming from excel - VBA

I'm very new to VBA and my first code is to copy excel tables and paste it at word. It's working, but the problem is that all tables are pasted left-aligned and I want it center aligned. Does anyone ...
0
votes
0answers
10 views

VBA - SetFocus error (Error 424: Object Required)

I've made a button to navigate to the next record, however, I also want to set focus on a text box (in my case "LastName") after the following record page loads up. The error is on ...
0
votes
0answers
14 views

Editing Pie Chart Layout in PHP DOCX or VBA

I am automatically creating charts using PHP DOCX to generate 20 charts per document, on over 500 documents. PHPDocx generates these ugly graphs, and in their source code, I find no option to remedy. ...
0
votes
1answer
21 views

Convert a Word 2003 document to PDF

Summary: I have Office 2003 installed with Adobe Acrobat Pro 9. I'm looking for a function to convert a few Word 2003 documents to PDF. With Word 2007, it is really easy as Word 2007 supports PDF ...
0
votes
0answers
36 views

Confusing VBA “mismatch error”

I am using VBA to pull data from Access into Excel. I know that using ADO code is the cleaner way to do this, but with the specific systems I am working with, ADO caused many issues. More ...
1
vote
1answer
25 views

VBA/Excel: How to highlight a cell based on changes for only 1 column

I have a small macro that highlights cells when they are edited based on what month it is. I would like to make this subroutine happen for only Column D. Is there a way to do this? Code is below: ...
0
votes
0answers
26 views

Automating tables creation with VBA code [closed]

Hi I have a challenge for the VBA savvy geniuses here. I am still a newbie hence here to seek your help. I am automating processes and need a code to automate the tabulation of items in worksheets ...
-1
votes
0answers
9 views

Importing Access VBA not accepting strings for source files [closed]

I have a strange problem with Excel VBA. I have programmed a spreadsheet to pull custom queries from various Access databases. I used the data connection wizard to go through MS Query to obtain the ...
0
votes
0answers
15 views

Visual Studio 2012 - Use XML to generate interface

I have a series of vb scripts, each having their own basic input and output. For example one script is used for backup, so its input is the drive letter that the backup should go to, the output is ...
0
votes
0answers
16 views

Formatting certain columns within pivot table

Within the context of a pivot table, I am looking to format any field item (column) that contains "MOM" within it's field heading. I could find no way to consistently apply conditional formatting ...
0
votes
1answer
31 views

Vba closing excel applications/workbooks freezes

I have a problem with the following code: Dim excelapp as object set excelapp = CreateObject("excel.application") dim ws as object dim wb as Workbook wb= excelapp.Workbooks.Open(path) ws= ...
0
votes
2answers
21 views

Excel macro input type not returning correct value

I'm trying to delete all cells that have the same interior color in an Excel 2010 worksheet using the following code: Dim myRange As Range Set myRange = Application.InputBox("Select a cell to remove ...
1
vote
1answer
22 views

Is it possible to pass parameters programmatically in a Microsoft Access update query?

I have a query that's rather large, joining over a dozen tables, and I want to pull back records based on an id field (e.g.: between nStartID and nEndID). I created two parameters and tested them as ...
-1
votes
1answer
18 views

Accessing data in specific line in section

I have an Access generated form with a section that contain a lot of lines (different records) I'm trying to get the data in a specific label in specific line in VBA. I am familiar with VB, but I ...
0
votes
0answers
21 views

Code needed to SendMessage using WM_USER for interprocess communication

OK, all you smart coders out there. I have been able to code a number of Visual Basic executable routines to do special things to control my home security system program, but have gotten stumped on ...
0
votes
1answer
24 views

Resize Tables in Excel from Access

The following code in theory should resize my excel tables when run from Access. I receive no errors when this is run but the tables in my excel file do not resize to all the data in the worksheets. ...
0
votes
2answers
33 views

VBA Append comma to end of integer, don't automatically change format

My current project is to rewrite a program that was written in 98. Their solution then was to do some in Excel, do this next part in Word, and then back to Excel in the 3rd step. The program syncs 2 ...
0
votes
1answer
25 views

Find method of excel vba in activated workbook

all hints that I find concerning search functionality in vba-excel refers to the same workbook. However, after activating another workbook, like in this snippet of code aDifferentWorkbook.Activate ...
0
votes
1answer
10 views

Copying external sheet to current workbook, Excel VBA

I'm working on small project in which I need to add sheets to the currently open workbook from any external database of worksheets in another workbook. I made a form to import any sheet that is ...
0
votes
1answer
22 views

Add string by user using form VBA

first I'd like to say that I'm new to VBA language and probably to some of you this thing seems easy. In a certain part part of my script I need to put a string (VIN from a car) using a form from ...
0
votes
1answer
36 views

How to change OptionButton fill color in VBA?

How can I change the fill color of an Excel OptionButton in VBA?
0
votes
1answer
26 views

For-looping issue VBA

I am having trouble with the following line of code. 'payFreq is input of type "Long" Dim DF As Variant 'discFact here is input of type "Range" DF = discFact.Value Dim Payment_pay() As Double ReDim ...
0
votes
1answer
21 views

Call a concatenate function into an active cell

I have a concatenate function (ConcatenateRange) which works fine on a variable 2 dimension array. I can call this function directly from excel without a problem in the cell required as follows: ...
0
votes
1answer
27 views

C# Add-in vs VBA Macro for Excel functionality

We would like to give users of our system the opportunity to drag some of the data from a database into Excel. (Only reading data, no chance of writing any data back to the DB). The users do not have ...
0
votes
0answers
27 views

pass sas macro variables to VB script as parameters

Below is the SAS code used to do forecasting and then create a excel output, once the output is stored in the excel file, i call a VBA macro to generate a graph for each excel file and for each sheet ...
2
votes
1answer
22 views

External Address that isn't fixed

I have two workbooks wb1 and wb2 with worksheets ws1 and ws2 respectively. I want to do something like this: ws1.Range("A1").Formula = "=100*" & ws2.Range("A2").Address(External:=True) ...

1 2 3 4 5 291
15 30 50 per page