Search Results

Search found 786 results on 32 pages for 'macros'.

Page 14/32 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Excel VBA creating a new column with formula

    - by Amatya
    I have an excel file with a column which has date data. I want the user to input a date of their choosing and then I want to create a new column that lists the difference in days between the two dates. The Macro that I have is working but I have a few questions and I would like to make it better. Link to MWE small data file is here. The user input date was 9/30/2013, which I stored in H20 Macro: Sub Date_play() Dim x As Date Dim x2 As Date Dim y As Variant x = InputBox(Prompt:="Please enter the Folder Report Date. The following formats are acceptable: 4 1 2013 or April 1 2013 or 4/1/2013") x2 = Range("E2") y = DateDiff("D", x2, x) MsgBox y 'Used DateDiff above and it works but I don't know how to use it to fill a column or indeed a cell. Range("H20").FormulaR1C1 = x Range("H1").FormulaR1C1 = "Diff" Range("H2").Formula = "=DATEDIF(E2,$H$20,""D"")" Range("H2").AutoFill Destination:=Range("H2:H17") Range("H2:H17").Select End Sub Now, could I have done this without storing the user input date in a particular cell? I would've preferred to use the variable "x" in the formula but it wasn't working for me. I had to store the user input in H20 and then use $H$20. What's the difference between the function Datedif and the procedure DateDiff? I am able to use the procedure DateDiff in my macro but I don't know how to use it to fill out my column. Is one method better than the other? Is there a better way to add columns to the existing sheet, where the columns include some calculations involving existing data on the sheet and some user inputs? There are tons of more complicated calculations I want to do next. Thanks

    Read the article

  • Is there unresizable space in latex? Pictures in good looking grid.

    - by drasto
    I've created latex macro to typeset guitar chords diagrams(using picture environment). Now I want to make diagrams of different appear in good looking grid when typeset one next to each other as the picture shows: The picture. (on the picture: Labeled "First" bad layout of diagrams, labeled "Second" correct layout when equal number of diagrams in line) I'm using \hspace to make some skips between diagrams, otherwise they would be too near to each other. As you can see in second case when latex arrange pictures in so that there is same number of them in each line it works. However if there is less pictures in the last line they become "shifted" to the right. I don't want this. I guess is because latex makes the space between diagrams in first line a little longer for the line to exactly fit the page width. How do I tell latex not to resize spaces created by \hspace ? Or is there any other way ? I guess I cannot use tables because I don't know how many diagrams will fit in one line... This is current state of code: \newcommand{\spaceForChord}{1.7cm} \newcommnad{\chordChart}[1]{% %calculate dimensions xdim and ydim according to setings \begin{picture}(xdim, ydim){% %draw the diagram inside defined area }% \hspace*{\spaceForChord}% \hspace*{-\xdim}% }% %end preambule and begin document \begin{document} First:\\* \\* \chordChart{...some arguments for to change diagram look...} \chordChart{...some arguments for to change diagram look...} \chordChart{...some arguments for to change diagram look...} \chordChart{...some arguments for to change diagram look...} \chordChart{...some arguments for to change diagram look...} %...above line is repeated 12 more times to produce result shown at the picture \end{document} Thanks for any help.

    Read the article

  • Controlling a browser from Python

    - by Noio
    I am looking for a way to control a browser from Python, i.e. fill out form fields and submit them, possibly call JS functions. I've looked around a bit, but as far as I could see PyWebKitGtk only lets you show the browser as a GUI element, not interface with it. Is there a way to do this easily? I wrote my program logic in Python, and I would hate to port it to JS. Besides that, even if I'd use pure JS "bookmarklets", those wouldn't be able to read/write to my local filesystem, would they? P.S. to quell your suspicions, I'm not trying to automatically fill out forum account creation forms or something similarly spammious, though the task is technically similar. I need to crawl/scrape sites for my research project.

    Read the article

  • Windows Macro + Hot Key - Paste Without Formatting

    - by JasonStoltz
    Not sure if this appropriate to put as a question or not? It's sort of a scripting question I think. Just down vote me if not :p Basically, what I'm looking for is a way to push a windows hotkey and have whatever text is in the clipboard be stripped of formatting. An example of what the macro could do: I push (whatever hotkey combo here) open notepad.exe Paste to notepad from clipboard Select all text in notepad Copy/Cut all text from notepad Close notepad I'm just wondering if someone has done something like this before, or knows how it could be accomplished. I think this could be a huge time-saver for almost anyone. I find myself doing this all the time when cutting and pasting between different office applications, etc.

    Read the article

  • Can you pass parameters for OnAction in MS Project VBA?

    - by Anne Schuessler
    The way I can define a method to be executed with OnAction in VBA with Microsoft Project is as follows (and works correctly): .OnAction = "Macro ""DoSomething""" ... where DoSomething is the method to execute. I would like to pass a parameter to that method but can't find a way to pass it with this syntax. Does anybody have an idea how to do this? I'm getting the feeling that this is an impossible task, but maybe there's some VBA secret I'm not aware of. Please note that VBA in MS Project seems to have its quirks and is slightly different than VBA for Excel or Access. This seems to be the case for the OnAction property which needs the extra Macro keyword to work correctly. If I'm wrong here please enlighten me.

    Read the article

  • Automatically taking screenshots of program window

    - by Sergey Kornilov
    I'm looking for a software that combines macro recording with screenshot taking capabilities. We have a software manual with a number of screenshots. When new version of software is released we need to update most of screenshots and we have to do it manually. Now we started translating manual to several languages and number of screenshots to take have increased ten fold. We'd like to automate this process. There will be a recorded macro or something that clicks button within our software and takes screenshots of the program window. Better yet, we can specify the name of each screenshot individually though it's less important. Does such a thing exist?

    Read the article

  • gcc check if file is main (#if __BASE_FILE__ == __FILE__)

    - by Marcin Raczkowski
    Hello. In ruby there's very common idiom to check if current file is "main" file: if __FILE__ == $0 # do something here (usually run unit tests) end I'd like to do something similar in C after reading gcc documentation I've figured that it should work like this: #if __FILE__ == __BASE_FILE__ // Do stuff #endif the only problem is after I try this: $ gcc src/bitmap_index.c -std=c99 -lm && ./a.out src/bitmap_index.c:173:1: error: token ""src/bitmap_index.c"" is not valid in preprocessor expressions Am I using #if wrong?

    Read the article

  • C++ macro definition unclear

    - by Tony
    Is this a macro defintion for a class or what exactly is it? #define EXCEPTIONCLASS_IMPLEMENTATION(name, base, string) : public base \ { \ public: \ name() : base(string) {} \ name(const x::wrap_exc& next) : base(string,next) {}; \ name(const x::wrap_exc& prev, const x::wrap_exc& next) : \ base(prev, next) {}; \ }

    Read the article

  • Preprocessor directive to test if this is C or C++

    - by Collin
    I'm trying to find a standard macro which will test whether a header file is being compiled as C or as C++. The purpose of this is that the header may be included by either C or C++ code, and must behave slightly differently depending on which. Specifically: In C, I need this to be the code: extern size_t insert (const char*); In C++, I need this to be the code: extern "C" size_t insert (const char*); Additionally, is there a way to avoid putting #ifdef's around every declaration in the header?

    Read the article

  • Stringification of a macro value

    - by SF.
    I faced a problem - I need to use a macro value both as string and as integer. #define RECORDS_PER_PAGE 10 /*... */ #define REQUEST_RECORDS \ "SELECT Fields FROM Table WHERE Conditions" \ " OFFSET %d * " #RECORDS_PER_PAGE \ " LIMIT " #RECORDS_PER_PAGE ";" char result_buffer[RECORDS_PER_PAGE][MAX_RECORD_LEN]; /* ...and some more uses of RECORDS_PER_PAGE, elsewhere... */ This fails with a message about "stray #", and even if it worked, I guess I'd get the macro names stringified, not the values. Of course I can feed the values to the final method ( "LIMIT %d ", page*RECORDS_PER_PAGE ) but it's neither pretty nor efficient. It's times like this when I wish the preprocessor didn't treat strings in a special way and would process their content just like normal code. For now, I cludged it with #define RECORDS_PER_PAGE_TXT "10" but understandably, I'm not happy about it. How to get it right?

    Read the article

  • __FILE__ In .h what does it resolve to

    - by Pablitorun
    Is there a specification on how the FILE macro will be expanded if it is in a .h? So if I #define MYFILE __FILE__ in foo.h and foo.c #includes "foo.h" void main(){ printf("%s",MYFILE); .... does this output foo.h or foo.c? (Yes I realize this is a stupid example) Sorry for what should be a simple question. The documentation on the web seems conflicting. For what it is worth VS2008 comes back as foo.c which is what I would expect....I think. I am just trying to confirm if this is defined behavior.

    Read the article

  • C macro issue: redefinition of functions / structure

    - by Andrei Ciobanu
    Given the following code (it's a macro that generates code for a list data structure, based on the contained type). list.h #ifndef _LIST_H #define _LIST_H #ifdef __cplusplus extern "C" { #endif #define LIST_TEMPLATE_INIT(type) \ typedef struct __list_s_##type { \ struct __list_s_##type *next; \ type value; \ } __list_##type; \ \ __list_##type * __list_##type##_malloc(type value){ \ __list_##type * list = NULL; \ list = malloc(sizeof(*list)); \ list->value = value; \ return list; \ }\ \ void __list_##type##_free(__list_##type *list){\ __list_##type * back = list;\ while(list=list->next){\ free(back);\ back = list;\ }\ } #define LIST_TYPE(type) __list_##type #define LIST_MALLOC(type,value) __list_##type##_malloc(value) #define LIST_FREE(type,list) __list_##type##_free(list) #define LIST_DATA(list) (list->value) #ifdef __cplusplus } #endif #endif /* _LIST_H */ And here is how the above code works: #include <stdio.h> #include <stdlib.h> #include "list.h" /* * */ LIST_TEMPLATE_INIT(int) int main(int argc, char** argv) { LIST_TYPE(int)* list = NULL; list = LIST_MALLOC(int, 5); printf("%d",LIST_DATA(list)); LIST_FREE(int,list); return (0); } My question, is it possible to somehow be able to call : LIST_TEMPLATE_INIT(int), as many times as I want, in a decentralized fashion ? The current issue with this right now is that calling LIST_TEMPLATE_INIT(int) in another file raise compilation errors (because of function redefinition): Example of error: error: redefinition of ‘struct __list_s_int’

    Read the article

  • Fill fields on a webpage

    - by MajuiF
    Hi everyone, I've already asked this question, but it's still too unclear to me, and it seems people haven't understood what I'm trying to do, so I'll try and be clearer. This website: https://www4.polymtl.ca/poly/poly.html is the website I want to fill. What I would like to be able to do, is modify the values of the "nip", "code", and "naissance" fields with text (for example, code being "majuif"). <input type=password name=code size=8 maxlength=8> <input type=password name=nip size=8 maxlength=8> <input type=password name=naissance size=8 maxlength=8> However, I don't know how to do that. And this is my problem. Should I write another HTML file - I don't know if the word "macro" can be used for that, but I'm pretty sure it can - and insert JavaScript in it? Please note that I'm not a professional in JavaScript or HTML, but I have basics, and still learning. Thanks, -Max.

    Read the article

  • MACRO Question: Returning pointer to a certain value

    - by Andrei Ciobanu
    Is it possible to write a MACRO that has a type and a value as its input parameters (MACRO(type,value)), and returns a valid pointer to a location that holds the submitted value. This macro should perform like the following function, but in a more generic manner: int *val_to_ptr(int val){ int *r = NULL; r = nm_malloc(sizeof(*r)); *r = val; return r; } Where nm_malloc() is a failsafe malloc. The Macro usage should be compatible with this usage: printf("%d",*MACRO(int,5)); Is it possible to achieve that ?

    Read the article

  • Excel VBA : Changing string in cells

    - by user1265125
    I have cells with data like these: ABCD123XYZ MPOP345MLU . . . . What I want to do is, to remove the 3rd and 4th character from all these cells, hence giving AB123XYZ MP345MLU How do I do this in VBA? I have no idea about this language, and if someone can guide me in the right direction, it'd be great :) I understand I have to: 1. Declare 2 string variables st1 and st2 2. Store data from cell A1 into the variable st1 3. Copy all but the 2nd and 3rd char into str2 4. Output Str2 into B1 5. Move to A2

    Read the article

  • Excel macro to change location of .cub files used by pivot tables? (to allow .xls files that depend

    - by Rory
    I often use Excel with pivot tables based on .cub files for OLAP-type analysis. This is great except when you want to move the xls and you realise internally it's got a non-relative reference to the location of the .cub file. How can we cope with this - ie make it convenient to move around xls files that depend on .cub files? The best answer I could come up with is writing a macro that updates the pivot tables' reference to the .cub file location....so I'll pop that in an answer.

    Read the article

  • SMS connecting to phone from VBA

    - by I__
    here's my code: Public Sub SendSMS() Dim n As Integer n = FreeFile ' Change the string below if using a different COM port or the port speed Open "COM3:9600,N,8,1" For Output As #n Print #n, "AT" Close #n End Sub i'm trying to connect to my phone that is attached to this computer. how do i catch responses to my AT COMMANDS? in hyperterminal you see responses right away, i want to be able to see them here as well, how do i do it?

    Read the article

  • excel quotes in formula question

    - by I__
    i have a column with this data: IT_AMPH IT_BARB IT_BENZ IT_BUP SOMA i want the column next to it to be literarely =like "*,IT_AMPH,*" =like "*,IT_BARB,*" =like "*,IT_BENZ,*" etc please note that i want the equal signed to be displayed, exactly as shown above what would be the formula for this?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >