Newest macros Questions

Q&A for professional and enthusiast programmers

Excel Macro - save all tabs (except specific ones) to single PDF file

Can you please help me with this? I would like to have a vba code that selects all tabs in the workbook, except for example "tab abc" and "tab def" and "tab ghi", then save to one single PDF. Thanks ...

VBA Open another workbook and sheet with variables

I could not find an answer to this yet: I have a sheet with the Customer name in Cell A2 and the product code in Cell B2. I have a file location "C:\Users\Reception\Documents\Shared\Item Master Data\...

Macro shows XCode that we're building from XCode

I have C project that supports building using CMake and xcodeproject (project is not built using CMake). External dependencies management is different in xcodeproject and CMake which leads to fact ...

VBScript to Open Powerpoint and Run Macro

I am trying to run a VBScript that opens powerpoint and runs a macro named UpdateandBreaklinks. The Script that I am running is as follows: Dim oApp Dim oPres Dim oSlide Set oApp = CreateObject("...

How to pre-process/unroll macros in Rust code? [duplicate]

Consider the following program: #[macro_use] extern crate quick_error; use std::io::{self, BufRead}; use std::process; use quick_error::ResultExt; quick_error! { #[derive(Debug)] enum ...

Macro Find Last Row and Add Data

Each week I pull data for a series of items and generate a pivot table. Some weeks, no data exists for one or more of these items. When this is the case, that item won't appear on the report. To avoid ...

Update Links in for Excel Spreadsheet Using Python

I am running simulations in Python that generate output that need to be directly consumed by a modeler in their excel workbooks. I have generated code that will directly output my data into their ...

Running a macro via task scheduler in Windows server 2012

We have created a macro to run in MS access (Office 365) on windows server 2012 so that it runs script that creates and sends emails via MS outlook. We can run the macro from inside MS Access but we ...

Macro To Read A Column and Make Separate Worksheets

I am looking to write a code/macro that will essentially take a table and utilize the data to make separate sheets that are copies of one another. Example: Column A: Price Chopper #1 Price ...

challenge? coding Powerpoint Filepath's

i have an assignement(for work) to make a program on powerpoint. i need to write a program that when u save your file on a specific place like d:\documents\here that the filepath needs to appear on ...

I want to use values that are in macro in java program [on hold]

I want to use value of a function written in macro in my java function.Could you please help me out.

Passing parameters to macro with a loop

There is a task to fill deep structure with macro, where names of structure components are similar and can be constructed by simple loop with index. For example, the structure is root-level1-level2-...

Unable to initialize array inside struct with ifdef'd macro [on hold]

I am trying to initialize a struct below, known as arduino_lcd_t. Because the peripheral I am using can either have data written to it four bits at a time, or eight bits at a time, I decided to have a ...

Segmentation fault on vsprintf using macros in C

I create a simple logger library in C.I have three files My example file: example.c Library files: loglib.h loglib.c My main logger function is called logme. I defined different macros as ...

Macro to sort data from multiple columns until next blank row, then repeat

I have a sheet with multiple tables on the same worksheet 'Sheet1' separated by a blank row. I want the VBA to sort one by one. Considerations Each table has different amount of rows In the future,...

ImageJ “Out of memory” error below memory cap

I'm working with a memory intensive plugin for imageJ on Linux which I run repeatedly though a macro. The plugin performs multiview deconvolutions. I have increased the maximum memory available to ...

False positives when putting 2 spaces after every sentence in Word VBA

I need a Microsoft Word VBA macro that puts two spaces after sentences that end with periods, question marks, or exclamation marks but not after decimal places in numbers (i.e., 4.5) or periods in ...

Franz LISP to Common LISP conversion 2 - macros which generate macros

I'm reviving an old LISP program from the early 1980s. (It's the Nelson-Oppen simplifier, an early proof system. This version was part of the Ford Pascal-F Verifier, and was running in Franz LISP in ...

Macro Redefined Warning

I'm writing this code and a warning appear when I tried to compile. #include <stdio.h> #include <math.h> #define EPS 1.5e-6 #define M_PI 3.14159265358979 int main() { double x1,x2,xm,y1,...

Does CPPUnit set some macros which I can use for disabling code in test-mode?

I want to test only parts of the code and disable other part with the dependencies which I don't want to include in tests. Are there any macros set in CPPUnit which I could use for that?

Stata: Invalid '`' error when using local macro

I am following instructions from this link on how to append Stata files via foreach. I think that it's pretty straightforward. However, when I try to refer to each f in datafiles in my foreach, I ...

Concatenating macro name before expansion

Let's say I have two macro definitions: #define TEST 0 #define TEST_NAME "Joe" I'd like to create a macro that can get access to the second definition from the first. I tried the following #define ...

How can i write a macro or conditional formatting to highglight a cell if

How can i write a macro or conditional formatting to highglight a cell if the column its in contains a number larger than a given number (i.e 100) and the cell in question contains 0 or less than ...

MaskDuplicateTests From a different sheet VBA - Macro

I'm having trouble with my Macro. I need to to group record by "Patient ID" and combine their test based on a separate tab. I have created a tab called "TestNames" that has the following information....

invoking macros in MASM

I'm in trouble. MASM macros don't seem to behave like C macros at all. C has a preprocessor which handles the text as a sequence of tokens, and you can put a macro call just anywhere. Not so in MASM ...

how to allow only specific users to unhide a worksheet

I already have a macro below that un-hides a worksheet at the click of a button and works okay. However I want this macro to be changed so that ONLY two users (whose usernames are "JSMITH" AND "...

Excel: Skipping a row in a macro when it can't find an image in a directory

I've been working on a macro that will add an image into a cell if the cell contains an image name (image1.png) that is in a specified directory. So if it could find "image1.png" in the directory it ...

need a macro code to execute the following template

Below is the input : heading 1 heading 2 heading 3 A 1 Apple B 2 ball A 3 Apple C 4 cat B 5 ...

use macro if condition in email notification

I am using a macro for if condition to check if a field is null or not, in a form email notification. I tried this one: {% if(City != string.Empty) { $$value:City$$ } #%} It did not work, and I am ...

Importing text files with the filename included

I initially wanted to setup a textbox where users can type in a date of a text file and click import(I created the from and did some coding but failed and could not find s upport for my issue). This ...

C Preprocessor to compute product specific include

I have to maintain C code that has both generic components and product specific components. I would like to simplify my code so that I have just one generic product.h file which has a structure like #...

How do I add a macro to a button in Access to export to excel?

Ok I have a SQL server back-end setup and it's data resides in Access. From there I would like to be able to generate graphs still so I want to export the data back to Excel. Yes I know Access can ...

Macro to join groups of values in a comma separated way

I need a macro to join together groups of heading 2, based on the value of heading 3: I need the the values to be comma separated without spaces or trailing commas.

Convert Word Macro that finds embedded objects to C# code

For Each varObj In ActiveDocument.InlineShapes If varObj.Type = wdInlineShapeEmbeddedOLEObject Then n = n + 1 End If Next varObj Snippet from Microsoft Word macro. Want to convert it to C#: ...

Macro to remove duplicates based on one column, then move the “older” duplicate to another sheet

I have a spreadsheet with data columns A through H. I need to remove duplicates based on data in column C. Easy enough. The tricky part is that I have a date in column E. I need the "older" duplicate ...

VBA HostExplorer Interaction

So i'm working with a new mainframe at my job and it's horrible. I don't need to get into specifics but whoever created it is a horrible human being... So for the past few weeks I've been coming up ...

Elegant mapping of C error defines to strings

Let's say I have a bunch of error codes in my application header.h like: #define SOMETHING_WENT_WRONG -1 #define SOLAR_FLARE_DECTECTED -2 #define ANTS_IN_YOUR_CPU -3 I return these as int ...

How to execute Batch File using Macros in Excel while passing parameters to the batch file through particular excel cell

What I am trying is to run a batch file placed at a particular path. The file requires user given inputs for which I want the parameters to be passed from certain partiucular excel cells. This all ...

VBA Split Workbook into multiple workbooks based on cell value

I have a workbook with over 200 worksheets. Each worksheet has salesmen name in cell M4. I want to create a macro that loops through each worksheet and splits the master workbook into separate ...

Identify the first instance of a word in a document. Am I on the right track for this Word VBA macro?

I need a macro that finds instances of “et al.” that are preceded by words that are the first instance of that word in the document. It should then find and move to the final instance of that word in ...

How does %If %else work in SAS Macro

I have the following code: %macro TEST(); %let prev=3; %do i=1 %to 4; %if &i>2 %then %do; %put prev = 5; %end; %else; %put prev = 0; %end; %end; %mend; Which, ...

How to use an excel macro (vba) to quit mail (on mac)?

Is there a way to run a macro that will quit the mail application on mac? I'm running this code to open mail and send an email: Function MailFromMacWithMail(bodycontent As String, mailsubject As ...

VBA macro to update data connection. Connection field not accepting a variable

I'm writing a macro that asks for user input to update the catalog and server fields within the connection string of an excel data connection. Sub Connection_String() Dim ConnectionString As String ...

Why forced inline function was not implemented on Mac with clang++?

Update 2.0 Thanks for many's great advice =-] Here comes the newest update: I tried to run four versions of addition: direct computation, macro function, forced inline and normal function call and ...

Create mulitple charts for each row using VBA Macros in Excel

This is my Excel sheet of name and monthly weight on "sheet2": and I have tried following code: Sub BMI() 'variable declaration Dim ws As Worksheet Dim ch As Chart Dim ...

How to copy certain row details into new workssheet if multiple condition is met? VBA

Im trying to copy a row of data from one sheet to another if column "I" contains a certain letter (or phrase) and if "D" column (dates) is between, january, february and so on. For instance, the data ...

Excel formula returns #REF when linking to external worksheets and copied

I have a spreadsheet October2016.xls with formulas for external links to other sheets. When I copy the sheets to a different directory, I will get a #REF error. For example, I need to link to Assembly ...

Access: Go to next record creates empty record

I have two buttons which cycles through records (employees in this case). Button one is Previous Record and it will navigate through all the emoloyees up till the first emoloyee. After reaching ...

Can we define macro for vowels?

The following, code snippet does not give compilation error, but it does not give the expected output either, though this could be done in simple if-else way but I wanted to do it using macros. Here c ...

how to pass cellrange to a user defined macro paramenter

i would like to work with cellranges within my macro. Function SumIfColor(SumRange) Dim oRange as object Dim oSheet as object ' Get Access to the Active Spreadsheet oSheet = ...
Translating... 0%