+ Reply to Thread
Results 1 to 2 of 2

vba code to write values to excel cells

  1. #1
    Registered User
    Join Date
    11-18-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2003, Excel 2013
    Posts
    1

    vba code to write values to excel cells

    Hi all. below is a copy of my vba code. I have an application from Rockwell automation called, factory talk view. Its object orientated software for displaying values and status of real plant time operation. Any way, it has a built in vba editor. I have setup the following vba code, to allow the two tag objects named "tag1" and "tag2", to be written to the cells A1 and B1. when "button4_relased" function occurs, the vba code executes, excel opens, writes the defined tag object values to the cells, saves the spreadsheet, then excel closes. This operates fine, but I need to change this so each time the function is called, the tag values are written to the next row, and not over A1 & B1 constantly. I can change .cells(1, "A") so 1 becomes a variable, but how do I read what the last empty cell is in the column? help please Anthony


    Please Login or Register  to view this content.
    Last edited by Anthony.h; 11-18-2013 at 06:26 AM. Reason: making code easier to read

  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: vba code to write values to excel cells

    Hi, Anthony.h,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    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. Write a code to put value copy two tyms and columb values to row
    By pranav.y in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2013, 08:25 AM
  2. How to format a code to write values to create a text file?
    By DakotaRoss in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 09:13 AM
  3. Code to write formula in 2 cells, copy, paste values, repeat next row until end of sheet
    By Oly Steel Man in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 11:13 AM
  4. [SOLVED] How do I write code to preserve variables values for future use.
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2005, 12:25 PM
  5. Combining Cells-write a code to get both values
    By Greg B... in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2005, 12:06 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