Visual Basic for Applications; a subset of Visual Basic used in all Microsoft Office applications. Consider using this tag together with the tag for the specific application in question.

learn more… | top users | synonyms

0
votes
1answer
14 views

VBA- Copy and paste error 1004

I was doing a code for vba and wondering why I received a runtime error 1004 when attempting to paste in sheets "Datasheet". It tells me the information cannot be pasted as the copy area and paste ...
0
votes
1answer
15 views

How can i create click function between A1 to A10 prompt inputbox for user to enter numbers in vba

I am trying to create input box for selecting range (A1 to A10), every time when i click any cells between 1 to 10, i want to prompt input box to enter numbers. That's what i did but it's not working ...
0
votes
2answers
12 views

How to set up lastrow selecting range in vba

Trying to set up last-row between ("B4:B17") and kept on getting an error(APPLICATION DEFINE OR OBJECT DEFINE ERROR), is there any other way i can set up last-row selecting range or what i am doing ...
-1
votes
0answers
22 views

Macro in excel to manage more than one worksheet? [on hold]

I need to set a macro to manage the "footer elements" in many excel files, and each file has many worksheets. I set the macro both with relatives reference and not, but I can view the modify only at ...
0
votes
0answers
16 views

Replace text with images in Word using VBA and avoid dialog box

I've been trying to replace specific text with a related image, but cannot stop the 'word reached end of doc, start at beginning' (press OK to keep code going) from coming up, despite Find.Wrap = ...
0
votes
1answer
31 views

Visual Basic and Excel data streaming in real time

I'm currently working on a program that runs in visual basic (not VBA). The program collects data from sensors and produces a data file (*.csv) of the information it collected after a certain stretch ...
1
vote
1answer
29 views

Copying cells to another sheet and inserting rows for the copied cells

I am trying to create a sub that copies information from one form (which has four cells) to another sheet. When it copies the information it also creates a new row. Each form has a maximum of ten ...
0
votes
1answer
15 views

How to compare differences for multiple possible pairs of cells in Excel

In Excel, I have 7 columns of data (numbers) spanning 100 rows. For each row, I want to check whether at least one number exceeds all other values by a certain value (say 0.2 or greater). If so, the ...
-2
votes
0answers
30 views

How to track changes in Excel 2010 like Word?

I have a workbook with a tab for each of 12 product lines. Each month the execs for that line make changes to their worksheet(s), depending on new products, different financials, comments or notes, ...
0
votes
0answers
17 views

Excel 2010 VBA Freezing panes when scrolling down (multiple headers)

I have a large spreadsheet with multiple headers in different rows, and I want to be able to freeze different headers while scrolling down and freeze pane. For example, A B ...
0
votes
0answers
19 views

Copy Top 10 from one workbook to other [on hold]

I have excel workbook as "Report June 21 - June 27" and each containing "ATT" sheet as first sheet. Report June 21 - June 27.xlsm I want to take the Top 10 in B, Q and R column by sorting Q5 by ...
1
vote
1answer
38 views

Excel: Write a 1 or 0 value if condition is met

Sorry if this has already been posted, but I just started today playing with Excel macros and I need a hand. I have a data column with values and I would like that if the conditions were met, the ...
-1
votes
0answers
20 views

excel 2010 VBA insert column headers [on hold]

I have a piece of VBA code (Excel 2010) that generates tables with 5 columns x 6 rows. There is an option to input the number of tables to be generated, as required e.g. 1 or 6 or 10 etc. basically ...
-1
votes
1answer
22 views

How to send email to mailing list in excel using gmail

Currently, when I type an email into excel it becomes a link. When I click on this link, the default browser opens a new gmail tab logged into whichever gmail account I am currently logged into, and ...
2
votes
1answer
33 views

Is it possible to add a custom calculation for a top level row total in a pivottable?

My Pivot Table has the following format Manufacturer MPG - Nissan 10 - Petrol 35 - Model A 30 - Model B 40 - Diesel ...
0
votes
0answers
19 views

Search for ID column in all worksheets and then search within those columns

I have multiple workbooks with multiple sheets on each. I am looking for a way to return the value under the column ID#, like to search all the sheets in the workbook. The header ID# might be in a ...
2
votes
0answers
18 views

Outlook 2013 VBA Editor Launches Without Displaying Debug and Edit Toolbars

Just an annoyance, but I've hunted through every editor command option to no avail. Just switched laptops, and in my old VBA editor it launched each time with no code windows open and the debug and ...
1
vote
1answer
44 views

Excel macro to format cells based on value and group with blank rows below

I'm trying to create an excel macro to format some data that is exported from another program. Here is an example of the data layout: ID Code SubCodes 1 A1 1 1 ...
-1
votes
0answers
21 views

Renaming a workbook and worksheet on clicking a button

Please find attach sheet. [Demo.xlsm][1] I have a Demo sheet . In it i have "Main" workbook which contains a button as"Next Week" which when clicked will change the date in "abc" sheet cell C1 to ...
0
votes
1answer
35 views

Excel formula from VBA difficulty

I have a formula that I want to generate in VBA and put in a cell. The final formula is: =IF(ISNA(MATCH(B6670,ProcMIRs!B1:B235,0)),"","Found in ProcMIRs row " & MATCH(B6670,ProcMIRs!B1:B235,0)) ...
0
votes
3answers
39 views

How can I spell out numbers in Excel?

There have been many times when I've wanted the cardinal version instead of the numeral version of a number. You could use a lookup table where you've typed out all the possible names but it's a pain ...
0
votes
2answers
29 views

VBA Ambiguous name detected error

I am trying to use VBA programming for Excel. What is happening is when I try to run this program I get this error and I do not under stand what it means?
0
votes
0answers
35 views

Heterogeneous Workbook Consolidation – Need Assistance

I have several Excel workbooks, each containing a couple dozen spreadsheets. The workbooks have different names and so do the spreadsheets, and simply mass consolidating doesn't help with the issue I ...
0
votes
0answers
26 views

VBA Excel Picture.Delete deleting form items

I am trying to delete and replace a picture. The system is work besides the fact that Picture.Delete is deleting the form items that control the script that deletes the picture. What is a way I can ...
0
votes
1answer
29 views

Copy range of cells within VBA module

I am trying to copy a range of cells in a specific sheet on the click of a form button Sub Button1_Click() Sheets("Marina").Range("A1:H10").Value = Sheets("Marina").Range("A13:H22") End Sub In ...
0
votes
1answer
29 views

How to write VBA code that looks to a cell for a column header in another sheet, then returns the corresponding column? [closed]

So I have a full spreadsheet of customers as columns and products as rows, the crossing cells indicating how many of each the customer has purchased. In another sheet i want to be able to run a macro ...
0
votes
0answers
29 views

Filename path in Word vba macro is unable to find building block.dotx file saved in network drive

I have a building block that I am using a vba macro to implement. The macro pastes a building block header into a section of the word document. The pasting of the building block works, when the ...
0
votes
1answer
9 views

Outlook 2007: how to add e-mail in table view to selection without the mouse?

In Microsoft Outlook 2007 I often select multiple e-mail messages in the tabular view (e. g. in the Inbox) to process them with a menu command or macro. Quite often, this is a selection of multiple ...
0
votes
1answer
58 views

Alternative to VBA in a banking environment [closed]

I work in daughter company of a bank where our "in house developed IT system" is being written in VBA - years ago, the bank simply imposed restrictions on us regarding what language we can or cannot ...
0
votes
1answer
26 views

Search through an email to find and highlight text

I'm working with Excel trying to automate the sending of some emails. Right now, the code creates an email based on the cells next to the button clicked, forwards the email to the listed in a cell, ...
0
votes
1answer
41 views

Macro that will run in MS Excel and LibreOffice Calc

I have a spreadsheet that users will be working with in both Excel and LibreOffice Calc. I'd like to design macros that will work in both. I was thinking of code that would say: If Excel Then [VBA ...
0
votes
1answer
40 views

How do I Reference all non-blank cells after row A6 for a Formula

I want to use the following formula: INDEX(A6:A94,MODE(MATCH(A6:A94,A6:A94,0))) Except the exact number of rows is ambiguous (imported using VBA). How can I reference all non-blank cells starting ...
1
vote
1answer
35 views

VBA; Fill down last line of an array to match the length of an adjacent column

So for an early stab at VBA I'm writing a macro: I'm pasting in a set of data that increases in numbers of rows each month; data is well organised with no blank values/columns I have formulae in ...
0
votes
2answers
22 views

How to determine number of rows in data, and use that value in defining a range

In my macro there is a line: Selection.AutoFill Destination:=Range("A2:A86893") but the final cell number (86893), which is the total number of rows in my data, should be changed every time the ...
1
vote
1answer
66 views

Excel VBA - Conditionally format a cell using 2-color scale based on 2 values (max/min) on other cells

I'm trying to write VBA codes to conditionally format (2-color scale) cell A1 based on its value that between is >= cell A2 and <= cell A3. I'm using cells A2 and A3 so I can change the specific ...
3
votes
5answers
100 views

Do whitespace and comments in VBA code affect performance?

I am new to VBA programming. I think I have seen it somewhere but I totally forgot where I saw it. Maybe I heard it from someone. My question: does the amount of comments and whitespace in VBA affect ...
2
votes
1answer
51 views

Excel VBA: Skip an Entire Row from Processing If Condition Is Met

Hello everyone I am relatively new to VBA coding in Excel (current version 2010) and I am trying to improve upon a simple program that suppresses small values in the tables my organization releases. ...
1
vote
2answers
54 views

Why is my constructed formula giving different results than the same formula as UDF in Excel?

Here's a long formula to calculate distance between two coordinates points on Earth =ACOS(COS(RADIANS(90-LAT1)) *COS(RADIANS(90-LAT2)) +SIN(RADIANS(90-LAT1)) *SIN(RADIANS(90-LAT2)) ...
1
vote
1answer
18 views

Format blank columns based on number of rows in spreadsheet

I'm attempting to color code blank columns in a worksheet based on the number of rows I have in my data set. I have an existing macro that sorts and formats my data but I want to add code to do this ...
4
votes
3answers
90 views

How can I 'align right' the results of Excel's “Text to Columns” feature?

If I am using the Text to Columns feature on the following data, using ";" as a delimiter: foo;bar;qux;baz;toast; quux;jam;beans; I'll end up with the results "left aligned" in the resulting ...
0
votes
1answer
63 views

Protecting a cell, but allowing the drop down list to work

I want to protect a cell that I have a drop down list in, but I still want the drop down list to work. When I try to protect it, the user is not able to use the drop down list to select other items ...
0
votes
1answer
30 views

VBA Code Isn't “holding” ThisWorksheet Parameter

I want to retrieve one column of values from another workbook and populate a tab in my current workbook. This will ultimately go into a much longer module I've written that works great. I just wanted ...
0
votes
1answer
39 views

Want to get the unique combination of data for dynamic number of rows/columns

I have a few rows (the number of rows should be dynamic) of data that I would like to combine, and get each unique combination. I am able to do that for a specific number of rows of data, but when the ...
0
votes
0answers
33 views

Is there a lesser code to insert records to sql using ms access vba?

Is there a shorter way to insert records to sql more than 30 fields?I am using MS access vba and Linked tables from sql. Can we Insert records using like this Insert into Mytable Values (more than ...
0
votes
1answer
29 views

Variables not Initialized in Excel VBA Loop

I'm back with another question in VBA. Here's the (updated) file I'm working on. When I try to run it, it says Run-time error '92': For loop not initialized. The loop is For Each var In accepted and ...
0
votes
0answers
52 views

Excel does not update formulas values after filling source cells with values

I do 3 steps: Based on a template, I create a new Excel file through code (it works fine): Shared Sub FillExcel() Dim extension As String = ".xlsx" Dim sourcePath As String = "c:\Temp\libro" & ...
0
votes
2answers
21 views

Initializing Variables

I'm working on a project that involves using Excel VBA. Unfortunately, I'm new to VBA and I think I ended up confusing myself while coding. Here's the file I'm working with. When I attempted to test ...
-2
votes
2answers
35 views

Use of Index in Ms-Access Database

Why does an Index make a query run faster? What does an index do? Particularly in Access, if you declare a column as an index how does it affect the query? Any Ideas?
2
votes
1answer
22 views

Can you lock out users from editing graphs in Excel

I have a tool written in VBA in Excel but I am having problems with users changing the graph data series. Is there anyway that when they open their copy of the file, to deny access to graph controls? ...
3
votes
1answer
57 views

Data transformation in MS Excel

looking for help on converting data from one format to another - If you want to see data in sheet is here - ...