+ Reply to Thread
Results 1 to 13 of 13

Amend Code

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Amend Code

    Hi,
    Can anyone help to amend this code? I need the code to add a zero in columns B&C in range if I in sheet 2 is not available.

    Please Login or Register  to view this content.
    Thanks
    Johnny

  2. #2
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Amend Code

    Upload the workbook........
    Lokesh Kumar
    Stay Hungry.. Stay Foolish..
    _________________________________________________________
    Please Click STAR to Add Reputation if my/someone's answer helped!

  3. #3
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Amend Code

    Try this cod......

    Please Login or Register  to view this content.
    If your question is resolved, mark it SOLVED using the thread tools. Click on the star if you think some-1 helped you.

  4. #4
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: Amend Code

    The code puts in 3 zero's for some reason even if I is available it still adds the contents in I + three zeros?

  5. #5
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Amend Code

    Hi
    Just do me a favor I know this is the second time I am saying this.....
    Run the code.......when it is putting 3 zero save the file and insert comment what you need and upload the file........

  6. #6
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: Amend Code

    I have attached 3 examples for reference, Sample A is with the macro run with no data in sheet 2 with I in column A, Sample B is macro run with I occurring once in sheet 2 column A and sample C is macro run with I occurring twice in sheet 2 column A.Hope this helps and if you need anything further please let me know.
    Attached Files Attached Files

  7. #7
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Amend Code

    Earlier you requested......Correct me if I am wrong....
    I need the code to add a zero in columns B&C in range if I in sheet 2 is not available.
    Here on sheet 2 I is only available on 1st line and 5th line...
    I 15 132 170.09
    R 7692.22 142.32 176.68
    T 2926.73 67.23 44.98
    W 4920.96 111.22 133.71
    I 16 220.61 170.09
    R 12456 142.32 176.68
    T 2926.73 67.23 44.98
    W 4920.96 111.22 133.71
    So output will only show you data in 1st line and 5th line

    15 132
    0 0
    0 0
    0 0
    0 0
    16 220.61
    0 0
    0 0
    0 0
    0 0

  8. #8
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: Amend Code

    Sorry, communication error, On review "I" will only occur once at any one time in sheet 2 and if "I" in not available I want a Zero placed in range instead of what is input from the data which is stored in "I", I should have been a bit clearer sorry.

  9. #9
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Amend Code

    It means after one time if "I" appear then it should place zero like this.......


    15 132
    0 0
    0 0
    0 0
    0 0
    0 0
    0 0
    0 0
    0 0
    0 0

  10. #10
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: Amend Code

    No it means that if I does not appear it places a 0 instead

  11. #11
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Amend Code

    Hi,
    Just check if it works for you........

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: Amend Code

    When the macro is run now with no I in column A Sheet 2 instead of a zero the code is inputting figures instead of one row of zero's in columns B&C within the row in range?

    So basically what sheet 1 columns B&C should look like in next available row when I is not available is sheet 2 is;
    Column A Column B Column C
    21/04/2015 0 0
    and if sheet 2 contains I with 15 in column B and 245 in column C then columns B&C in sheet 1 next available row should show;

    Column A Column B Column C
    21/04/2015 15 245
    Attached Files Attached Files

  13. #13
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Amend Code

    Quote Originally Posted by Burt_100 View Post
    No it means that if I does not appear it places a 0 instead
    The Initial code I have pasted is doing the same job........if It is finding "I" in sheet 2 it is copying the data from next 2 cells and pasting into last available row in Sheet 1....If there is no "I" then it is going to put 0....

+ 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. [SOLVED] Please can someone help me amend this piece of code
    By twaccess in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-10-2018, 05:38 AM
  2. [SOLVED] Help require to amend the code
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2015, 09:50 PM
  3. Amend Code help
    By VBA Noob in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-21-2006, 03:16 PM
  4. Amend code
    By VBA Noob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2006, 05:32 PM
  5. Amend the Code
    By shan_in_dubai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2005, 04:36 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