+ Reply to Thread
Results 1 to 11 of 11

Need help in amending code

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Need help in amending code

    Hi, i need some help in coding. My code is as below

    Please Login or Register  to view this content.
    Can some help help me to amend the code so that
    1) its from E2 to last data
    2) look for the word "Difference" in Row1 then down to last data

    Will appreciate if you can paste both 1) and 2) code so that i have a better understanding.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Need help in amending code

    What needs to be done if the word "Difference" is found?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Need help in amending code

    If the word "Difference" is found in Row1, then go down to last data. Coz currently, my "Difference" is in E1, hence i put E2:E50000. HOwever, they might insert column. Hence my "Difference" might go to F or G.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Need help in amending code

    Just cursor should goto the last data?

    Whether always difference will be in First row?

  5. #5
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Need help in amending code

    Nono. Its to check for cell.Value<>0 Currently i am using a fix range E2:E50000. However, i wan it to be dynamic.

  6. #6
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Need help in amending code

    Ok, I just done a sample of what i am actually doing. I have a cell where i do the checking which is Row C minus Row D.
    My code will prompt the user that there is a difference whenever he close/open the workbook. HOwever, my range is E2:E50000 which i am afraid that user might insert column or what.

    Hence i need help to for

    1) Change the E2:E50000 to E2 to last data
    2) Look in ROw 1 for "Difference" and down to last data.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Need help in amending code

    hi, anyone can help?

  8. #8
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Need help in amending code

    This seems to work...


    Please Login or Register  to view this content.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Need help in amending code

    Try this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  10. #10
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Need help in amending code

    Quote Originally Posted by bakerman2 View Post
    Try this.

    Please Login or Register  to view this content.
    Is it possible for u to explain in simple english wat the first few line mean?

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Need help in amending code

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Amending code to add array
    By dms2228 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2013, 01:45 PM
  2. Need help with amending code
    By ea223 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2013, 01:10 AM
  3. Help Amending a bit of VBA code
    By cldcp00 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2013, 04:48 PM
  4. [SOLVED] amending some code to include an if clause.
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2012, 09:16 AM
  5. Amending code based on cell value
    By excellentexcel in forum Excel General
    Replies: 13
    Last Post: 06-27-2009, 01:38 PM
  6. Amending code
    By khalid79m in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2007, 03:23 PM
  7. Help amending code
    By Steve in forum Excel General
    Replies: 4
    Last Post: 08-17-2005, 11:06 AM
  8. Help with Amending this Code Please
    By [email protected] in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-01-2005, 03: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