+ Reply to Thread
Results 1 to 6 of 6

Excel VBA Coding - How to prevent macro writing over data?

  1. #1
    Registered User
    Join Date
    11-15-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    19

    Excel VBA Coding - How to prevent macro writing over data?

    Hi and thank you for looking at my post....

    I'm hoping someone can help me out with this VBA coding issue.

    We had a developer working with us for a while and one of his tasks was to develop the code attached, for doing our queue surveys... however, the individual has now left and we have had no joy trying to contact him/her to assist us with a bug fix that we have identified.

    ISSUE :- The system operates well however we have noticed that if you start a survey and the finish it..... if you then go back into the same file to restart the macro it starts to overwrite the values from the top of the excel page - this is our main issue.

    Can anyone assist with adding the missing code etc... which will stop the macro from overwriting the data when there are values already present. - it would also be good to identify the code that fixes this issue,so that I start to learn a bit as we go.

    Hopefully I have explained it well... although if you have any question then please feel free to ask me.

    Here's hoping someone can help.

    Thanks Uzz.
    Attached Files Attached Files
    Last edited by Uzzgee; 09-01-2013 at 10:46 AM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: HELP ... Excel VBA Coding - How to prevent macro writing over data ???

    Hi

    All you have included is the userform

    We would need the whole workbook.

    Clear out and data first.

  3. #3
    Registered User
    Join Date
    11-15-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: HELP ... Excel VBA Coding - How to prevent macro writing over data ???

    Hi mehmetcik,

    Thank you for your reply ... sorry about the mix up.

    I have now attached a .xlsm file with the macros etc attached.

    The macro to start the process is called "Start_InOuts"

    Hope this now works and allows someone to look at it.

    Hope someone can help.

    Thanks

    Uzz
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Excel VBA Coding - How to prevent macro writing over data?

    Hi

    You need to change the top of this part of the Macro. Inert the portion between the "*****************

    I appreciate that you might have a security issue so I am not going to amend your code.

    Also do you find this Macro to be slow or is it meeting your requirements?

    I will explain on a seperate post but for now insert that code and you should be ok.


    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: HELP ... Excel VBA Coding - How to prevent macro writing over data ???

    This piece of code steps through the cells horizontally starting at C2 looking for the first empty cell.
    Not to much of an issue unless you add a lot of columns which is probably doubtful.

    Please Login or Register  to view this content.
    This could be replaced by:-

    Please Login or Register  to view this content.


    This bit of new code which is based on the original code for security reasons.
    steps through the cells Vertically starting at B2 looking for the first empty cell.

    Obviously as you add to the database this will become time consuming.

    Please Login or Register  to view this content.
    This could be replaced with the following code which will be instantaneous:-

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-15-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    19

    Thumbs up Re: (SOLVED) HELP ... Excel VBA Coding - How to prevent macro writing over data ???

    Hi mehmetcik,

    I have updated the code and it works perfectly - thank you so much for your assistance.

    Also, many thanks for the additional coding to help performance etc.... the 1st chance we get to test/run the system I will monitor the processing speed and if i find it to be an issue i will deploy the additional changes that you have advised.

    Once again many thanks.

    Uzz

+ 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. I need help in writing Macro to compare data in two different excel workbook
    By shanvin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2013, 01:06 AM
  2. VBA coding issue - new to writing macros please help with automatically running my macro
    By ironmonkey88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2013, 10:10 AM
  3. Urgent help for writing text file to excel using macro coding
    By praveenvinay in forum Excel General
    Replies: 0
    Last Post: 06-26-2012, 09:02 AM
  4. Help in writing an Excel Macro for copying the data from one excel to another
    By Jairam in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-16-2012, 08:13 PM
  5. Macro coding for writing new sheets
    By ecologue in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2011, 02:21 AM

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