+ Reply to Thread
Results 1 to 6 of 6

VBA program for cell increment from external file

  1. #1
    Registered User
    Join Date
    03-14-2016
    Location
    Ulm, DE
    MS-Off Ver
    2010
    Posts
    3

    VBA program for cell increment from external file

    Hello,

    Can someone help me creating a vba program, to increment the cell value by 1 from a value in the external file. The value of both cells should be increased from a click of the button.

    Thank you so much in advance.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA program for cell increment from external file

    Hi, welcome to the frum.

    Just create a simple file with one sheet and a starting value in cell A1 (this value will be the next value to use)
    Save this file with something like RefNr.xlsx

    All you need to do now is open the workbook you're working with.
    write a macro hat open the regnr.xlsx file store the value in A1 to a variable
    Un the value in A1 + 1 and save and close the regnrs file
    The variable will have the next number
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    03-14-2016
    Location
    Ulm, DE
    MS-Off Ver
    2010
    Posts
    3

    Re: VBA program for cell increment from external file

    Hi Keballah,

    Thank you for the response. But I require from a single click, the value in two excel differnet worksheets should be incremented. I would be great you could provide some sample program. Since I am just a beginner in vba.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA program for cell increment from external file

    It's a single click once you have the macros.
    So if you're really that a beginner what do you want to do, ask for every little modification?
    I do not know where the value is to be stored in the worksheet, you mention TWO oka, I think you mean one that holds the next value and the one where you required this upped-value?

  5. #5
    Registered User
    Join Date
    03-14-2016
    Location
    Ulm, DE
    MS-Off Ver
    2010
    Posts
    3

    Re: VBA program for cell increment from external file

    There are basically two files. The one that contains the value (for example: excel file- source.xls, A1= 10), and the other file where the value should be stored (eg: target.xls , to be stored in range A1 as 11).

    So from a click of a macro button., the value should be incremented in source.xls and the 'incremented value' should be stored in the target.xls file.

    Thank you

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA program for cell increment from external file

    Yes, you understood perfectly.
    Did you create the file? Did you record the macro?
    Now just link the macro to a button.

+ 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. External Data from Microsoft Query - Excel File - Causes external file to open.
    By lee1000d in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2015, 02:25 PM
  2. Formula to open external file with especific program (like open with)
    By pemartins in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-14-2014, 06:38 PM
  3. Replies: 2
    Last Post: 02-18-2013, 05:19 AM
  4. execute external program when cell reaches certain value
    By Brendan DJ Murphy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2011, 10:27 AM
  5. Excel 2007 : Increment Date in External Reference
    By zt8zf in forum Excel General
    Replies: 0
    Last Post: 08-01-2011, 11:36 AM
  6. External File(s) referenced and file links change based on row cell.
    By Jimmydageek in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-23-2009, 02:59 PM
  7. Pass cell contents to external program as commandline option
    By Research freak in forum Excel General
    Replies: 1
    Last Post: 09-16-2005, 07:05 PM

Tags for this Thread

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