+ Reply to Thread
Results 1 to 2 of 2

VB Script or Macro? Not sure which.

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question VB Script or Macro? Not sure which.

    Never did any extensive work in Excel. I was a Lotus pro for years. I need help with the following:

    I want to check a cell to see if it's empty. If it is I want to get the cell content of say, C31, and place it in the current cell. If it already contains data I want to move DOWN one and recheck until I get to the next empty cell to populate.

    I know this is wrong but my thinking is

    IF(ActiveCell="",=C31,DOWN)

    But I'm thinking FOR loop will work better.

    Additionally I need to know if it's better to do a VB script or a simple macro.

    Thanx,
    HH

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: VB Script or Macro? Not sure which.

    Hi, HH,

    you choose the wrong forum to post your question (should have been General or VBA, maybe thread can be moved there by staff? TIA).

    Automatic, for one cell only, for a range, which cell to copy from where? A lot of additional questions.

    A macro which needs to be started by hand checking the contents of the presently active cell and adding the value form the cell above may look like this which doesnīt take care of Formulas in the cell returning "":
    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Regarding VBScript or "simple" macro: this depends on whether you wan the code to run from within the Application Excel (this is what you may think of to be a macro) or from outside of Office/Excel. But that may only be answered from you as I canīt see what you really want to achieve and thus provide more detailed information.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. help me on macro script
    By vimalanathk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2012, 06:56 AM
  2. Integrating Mainframe emulator script with excel's vba script
    By Himanshu Mishra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 10:30 AM
  3. How to run a Macro from a vba script
    By datahouse in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-02-2011, 01:09 PM
  4. Create VBA script to short, dedicated button in excel for script?
    By realized in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2009, 11:54 PM
  5. Script that edits the text printed on the button that runs the script
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2008, 02:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1