+ Reply to Thread
Results 1 to 5 of 5

Help with a vba code to overwrite cell data

  1. #1
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    Help with a vba code to overwrite cell data

    I have a sheet called "Player Info". And the data on this sheets gets entered in from a userform. The code below works great but what I would like to do is when the user clicks a button on the userform (commandButton3), I would like to update the info on the Player Info sheet with the new data entered in from the userform. Right now it just adds another row with the same data. For instance if I want to change the data in textbox3 from AM to AL right now it just adds all the data again. Sorry I forgot to mention that This userform is brought up by double clicking a cell and auto fills in with the data already on the sheet. This code is below the first code.



    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thanks for the help in advance
    Excel 2010

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Help with a vba code to overwrite cell data

    It looks like you are populating the UserForm with data from the ActiveCell row. This will write back to that same row.

    Change this...
    Please Login or Register  to view this content.
    To this...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Help with a vba code to overwrite cell data

    Very simple but absolutely perfect. Exactly what I needed. Thank you so much!!!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Help with a vba code to overwrite cell data

    You're welcome. Thanks for the feedback.

  5. #5
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Help with a vba code to overwrite cell data

    Dang, it was that simple!!?? I just went and rewrote the code that I use (that was provided by a member here) to edit a row with my userform to work with Zimmerman's userform and came back and it was already solved
    Oh well, not sure if the code I have would have worked 100% though.
    Here it is just in case.
    Please Login or Register  to view this content.
    You might have to change the numbers in the (Target.Row, x) to the number of the columns you need the info from.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

+ 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. Sync data on two sheets and instead of overwrite comment the changes in the cell
    By markpem in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-10-2015, 08:46 AM
  2. prevent data cell overwrite
    By robhelps in forum Excel General
    Replies: 2
    Last Post: 07-06-2012, 12:12 PM
  3. Code for asking for overwrite YES/NO
    By zyrr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2012, 09:53 AM
  4. Prevent data cell overwrite but allow blank cell overwrite
    By Squasher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2011, 09:24 AM
  5. VBA code to overwrite contents of cell
    By laffers in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2011, 01:04 PM
  6. Add cell data to blank, but do not overwrite data
    By cinman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2010, 03:47 PM
  7. if cell has data or values then cannot overwrite
    By Burke in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2008, 01:15 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