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
19k views

Excel vba code for adding a value to existing cell of sheet

i have this code to add value of a cell to existing value of other cell which is below Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Not (Intersect(Target, Range("E3")) Is Nothing) ...
0
votes
3answers
24 views

How to change the font of a specific formula which is part of an Excel Cell?

="InterContinental Vienna @ "&M9&" "&M42&" p/room p/night" based on the above example, M9 = EUR and M42 = 150 Result I am looking for is: InterContinental Vienna @EUR 150p/room p/...
3
votes
3answers
2k views

Lost VBA when downgrading from Excel 2013 to Excel 2010

I am on Windows 7. In the past I was using Excel 2003. I installed Office 2013 and found that my Office 2003 was intact and I could run both versions. I made updates to some worksheets using Excel ...
0
votes
1answer
11 views

Access MsgBox for automated email

I have an Access DB set up with VBA code for a yes/no command button to send an automated Outlook email. If user selects Yes, it opens the email to allow for attachments. My problem is that when the ...
0
votes
1answer
15 views

Send bulk mail using Excel VBA

Was working on a project which will be sending bulk mail to different people if the conditions are met. Conditions : Column U contains the final status (Open or WIP) (will not send if Closed no ...
0
votes
1answer
11 views

Updating link paths with Word VBA

I have the following links to Excel in a word document: The issue is that when changes are made the document version on both the excel sheet referenced and the word document change. As such I will ...
0
votes
1answer
21 views

Excel VBA: Loop To Fill In Sequence Numbers In A Column

I am new to Excel VBA and I am currently working with a project that needs to autofill sequence numbers in Column A depending on the filled range in the Column B. With the code below that I found in ...
-1
votes
0answers
8 views

Extract Data from Sql and display the results to excel sheet

I am trying to execute this code, but it does nothing and shows no errors too. Basically, I am trying to extract specific information from sql table and display the results in excel. I have a button ...
1
vote
1answer
4k views

VBA: How to replace entire Excel cell value basing on its content?

I have an Excel Spreadsheet with some names in a cells. There can be as one name per cell as multiple names in one cell. For example: Cell A5 contains "Joe", cell BD54 contains "Joe;Harry;Molly", ...
1
vote
1answer
18 views

Move between sheets every 10 sec, and bring data every 20 min in one code

I need a script that switches between sheets every 10 seconds, and then runs some code every 20 min that brings some data using copy-paste function, and then loop until I press "Esc". This is my code ...
0
votes
0answers
18 views

having to keep track of previous day on a qry and data mart update that updates daily in excel

I am currently the "numbers guy" on my team. I have been able to add multiple query data onto one sheet keeping track of multiple parts of my teams stats. I was trying to do something that keeps ...
0
votes
0answers
17 views

Apply formula to cells with data

Is it possible to apply a formula to cells with data without using macros? For example, user enters "A3 A6 A8" in a cell, and then it applies UDF "CONCATENATEREF()" to that cell that gets those ...
1
vote
1answer
21 views

Show Form from cell click, then CommandButton to pass to next ActiveCell

I'm creating an input form for use with a 'tablet' PC in Excel for our guys to fill out when in the field. As inputs like drop-down menus and the like are quite fiddly, I wish to use a basic input ...
1
vote
1answer
33 views

Splitting one Row with Multiple Columns into Multiple Rows

So I picked up this VBA code ... Sub NewLayout() For i = 2 To Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row For j = 0 To 2 If Cells(i, 3 + j) <> vbNullString Then ...
2
votes
1answer
3k views

How do I make Outlook 2010 print attachments automatically?

I'm trying to get Outlook 2010 to print attachments automatically apon arrival. I've found this on the internet. The VBA code is Sub LSPrint(Item As Outlook.MailItem) On Error GoTo OError ...
-1
votes
0answers
21 views

Count while variable is not changing, vba [on hold]

In my vba code I have a table that consists of hundreds of lines. ie: Table(1) = TRE12_DO Table(2) = TRE12_DO Table(3) = TRE12_DO Table(4) = TRI12_DO Table(5) = TRI12_DO Table(6) = GRO12_DO ...
0
votes
2answers
32 views

Protect content of certain cells without protecting worksheet

We have a excel 2016 workbook with multiple tabs, each tab is dedicated to a specific sales person. Each salespeep, logins from a form, and his (only his) worksheet is unlocked and allow for editing. ...
3
votes
4answers
60k views

How do I move the selection down one row in Excel 2007?

Is there a way to move a selected range to the next row? Let's say I have "E9:H9" selected and want the selection to move to "E10:H10". Is there a shortcut for it? The selection should not be ...
0
votes
1answer
3k views

Updating another Excel spreadsheet from current spreadsheet

I used the VBA code in "How do you write an Excel formula that will paste a specific value in a different cell?" posted here in May 2013 and it works well to populate/fill another cell in the same ...
3
votes
2answers
67 views

Excel & VBA - Where is underlying code for functions?

I was wondering if there's anywhere in Excel, or online, that I can use to see how the Functions in Excel are working. The idea is that I'm starting to learn how to make UDFs, and do various things ...
-1
votes
0answers
16 views

Copy and paste to new document without external links

I am creating a set of 8 Excel templates for a project. Participants will be given a USB thumb drive with the templates, which they will use to create claim forms for the project (each participant ...
0
votes
1answer
5 views

Word Macros missing from a word doc in the network drive

I had lot of macros/VBA scripts for processing comments, merging etc in one few he word doc(word 2013)files on shared drive. i changed my computer and now i don't see any of the macros in those ...
0
votes
0answers
21 views

How to use macros/VBA in Excel to copy/paste 3 portions of a large column of a workbook to a specific position in another workbook?

I am very new to VBA (know next to nothing about how to code in it) but have a basic understanding of how coding works. I am curious if anyone could help me with a script idea I have to automate ...
0
votes
3answers
60 views

Excel VBA - code to skip lines / goto command

I have built a code into excel to take the data from a pivot table and insert it into a chart, a pivot chart directly linked to the table wont give me the manueverability I am looking for. The reason ...
1
vote
1answer
40 views

Macro to loop through a web query - keeps bombing

I have built a macro intended to loop through stock tickers and in a column and use a web query to pull data on those stock tickers from yahoo finance It runs fine for 10,15,20 web queries but ...
0
votes
1answer
52 views

Delete multiple rows according to a pattern

I'm working with an Excel sheet of 256,923 cells data and I need to delete 29 cells after each single cell. If I would do it manually, it would take me hours. So, is there anything I can do to reduce ...
2
votes
2answers
5k views

VBA code to insert custom signature in Outlook 2007 email

I need to insert a specific signature into an email message. Our support team uses a variety of different signatures to respond to different types of support needs. Currently, I access them via the ...
0
votes
0answers
14 views

Word Template for Automatic Object Placement?

I have a series of data "objects" that are typically used to prepare reports. One class of objects are MS Excel tables. The second set are graphs from a stand alone app (GraphPad Prism) - these can be ...
-1
votes
0answers
12 views

Compare 2 corresponding Columns with different sheet and find duplicate

Compare B & A between Master list and results, duplicate paste in Follow ups sheet, and non duplicate paste in Master List, and remove duplicate from result before pasting rest of the results to ...
0
votes
1answer
10 views

How to convert tabs to indents in Microsoft Word

When copy pasting text from another editor to microsoft word, paragraphs come with tabs in the beginning. How to convert those to paragraph indents, to get better formatting?
0
votes
4answers
10k views

EXCEL - How to have a formula output and user input on the same cell?

I would like help from someone as I believe this problem requires VB. I basically have a CELL(A4) where people will be entering values to find out the corresponding calculations displayed below. ...
0
votes
1answer
5k views

How to customize Paste Value Excel Short Cut

I was reading in this other post how to set up VBA code to paste values in Excel. I understand how to create the VBA code. I would like to set the keyboard shortcut to Ctrl d but Excel pops up an ...
1
vote
2answers
4k views

Excel 2010 Legend key color based on text

Background I've an excel template. This template I populate with data by running a program I've written. The excel template has a pivot table on a sheet that get's data from another sheet that I've ...
-2
votes
0answers
28 views

VBA Macro for Splitting data into separate Workbooks based upon a Common Cell Value: Naming the File

Trying to augment the following script to name the subsequent saved workbooks after the reference cell and cell 9 of the pulled row. Public Sub SplitToFiles() ' MACRO SplitToFiles ' Last update: ...
2
votes
2answers
747 views

How to load an Excel add in and use a User Defined Type from that add in?

In add_in.xlam I have: Type Quantity i As Integer end type Sub show_quant(q as Quantiy) MsgBox(q.i) end sub In another workbook, I do: Sub load_addin() Dim AI As Excel.AddIn Set ...
-1
votes
1answer
54 views

Best way to prevent running malicious/virus macro on PC

I've got a question. Could You provide some hints/solutions about preventing running suspicious macro's in Office apps? What I've already know: there is a possibility to turn off all macro's without ...
0
votes
3answers
77 views

By using VBA how do i compare values

VBA code Sub loopchange() 'select the blank column Dim level As String Range("AF2").Select Do 'move to A2 cell' ActiveCell.Offset(0, -31).Select 'find out which is level2 If ...
0
votes
1answer
30 views

Excel 2010: Blank pasted cells require activation causing formula issues

I'm having a problem copy/pasting from one Excel file to another. I have a workbook with forms for entering data. Recently, I added a sub to auto-capitalize the entry cells. Private Sub ...
0
votes
3answers
6k views

Run excel macros (vba) from vbscript file

I have a vbs file that pulls information from my database and exports the data to an Excel file (C:\file.csv). Once this is done, I run a series of macros (vba) to format this data. These macros are ...
0
votes
0answers
28 views

Order / Sort by in VBA

Hey guys I am writing some data crunch script that is processing data and filtering them. My question is how can I select the hole range of my column , and make specific attribute unique. ? ...
1
vote
2answers
10k views

Call PowerShell script from Excel macro

I'm trying to call a PowerShell script from a macro in Excel. I have seen a number of examples along the lines of: retval = Shell("powershell ""C:\MyTest.ps1""", 1) When I try to use this, ...
0
votes
1answer
17 views

VBA coding for Outlook

Does anyone know if the vba code that is produced in Outlook 2016 is backwards compatible with 2010. I use 2007 at home & 2010 at work. I wrote a program in 07 and needed a lot of head scratching ...
-1
votes
1answer
32 views

Excel Macro to add rows until today's date and update following columns accordingly

I got an excell sheet with 3 worksheets that I update like every 2-3 days manually by dropping down the date column and it automatically updates the columns based on the date. For example: Let's say ...
-1
votes
1answer
30 views

How to change the fill color of a shape using an excel 2013 button in vba?

I'm trying to develop an excel version of a baseball scorecard with diamonds representing first through third base and a pentagon for home plate. Currently I'm working with just the first players ...
1
vote
1answer
22 views

excel create a custom vba function?

Can anyone help me create a vba function to execute the following? In Sheet1 I have 3 columns A(product) and B(price) which are populated with 3000 items and 3rd column C(quantity) which is not ...
0
votes
4answers
6k views

Excel VBA or Formula to convert text to Date with Time type

I have a quite a number of data where its date/timestamp has been imported into excel as text. Excel does not really recognize it as date with time. e.g. 25.08.2011 16:17:59 (mm.dd.yyyy hh:mm:ss) ...
2
votes
2answers
3k views

VBA to move specific data from one column to another

I've tried requesting help with this before but have received no helpful responses. I need a Macro/VBA that moves any word in red from column A into column C as a list. However if the same word is ...
1
vote
2answers
3k views

Format Change Event for Excel VBA

I'm trying to prevent people from modifying (most) of my spreadsheet while still alowing them to use the sort function of the AutoFilter. What I've done so far is used the Worksheet_Change event and ...
0
votes
1answer
10k views

Getting “Application Defined or Object Defined” error '1004"

So I was trying to copy data from different sheet and paste on current and I am getting this error: "Application Defined or Object Defined" error '1004" Can someone help me with this ? Option ...