+ Reply to Thread
Results 1 to 16 of 16

How to get a border to separate 'ID'?

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    How to get a border to separate 'ID'?

    Hi Friends,

    In the attached workbook the macro is generating the serial numbers but the serial numbers are repeating for same ‘ID’ which is in column ‘B’. If the ‘ID’ in column ‘B’ is same then I want a serial number for only first ‘ID’ and the rest should be blank. I also want a thick horizontal border to separate ‘ID’. The require output is shown on the ‘output’ sheet.

    Any help will be highly appreciated.

    Thanking you in anticipation.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to get a border to separate 'ID'?

    Non VBA solution:

    for the first question

    a2= =if(countif($B$2:B2,$B2)=1,MAX($A$1:$A1)+1,"") and drag down


    for the second question I have no answer
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to get a border to separate 'ID'?

    Hi oeldere,

    Perfect! Thank you.

    For the second border problem assistance requested.

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: How to get a border to separate 'ID'?

    Hi - if you put the following in your Sheet1 object that should do it.
    Please Login or Register  to view this content.
    Hope that helps.
    Attached Files Attached Files
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to get a border to separate 'ID'?

    Hi MatrixMan,

    Thank you. No, it's not as per output shown on 'output' sheet.

    Doesn't matter. I used conditional formatting to get border. However, I didn't get a thick border there. Is it possible to change the particular horizontal border thick by code?

    Thank you and have a nice time.

  6. #6
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: How to get a border to separate 'ID'?

    As far as I'm aware, you can't do thick borders in conditional formatting. The output from the code is the same as the output sheet except for the blank rows at the end, which I thought were a mistake. I'm sure you can modify it to add them in if you like.

  7. #7
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to get a border to separate 'ID'?

    Yes, I agree with you. So I asked you that can we change the particular horizontal border to thick border by a small code because there is already a lot of codes.

    Have a nice time.

  8. #8
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: How to get a border to separate 'ID'?

    This will search column A of your sheet with conditional formatting and put a thick top border above an cell with conditional formatting.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to get a border to separate 'ID'?

    Thank you. I'm getting compile error 'invalid use of me key word on the following line
    Please Login or Register  to view this content.
    Thanking you,

  10. #10
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: How to get a border to separate 'ID'?

    That's because (I suspect) you've put the code into a standard module rather than the sheet object of the worksheet you're formatting. If you must have it in a module then you need to replace "me" (meaning "this sheet") with the explicit reference to the sheet.

    So - define a worksheet that you want to write to:
    Please Login or Register  to view this content.
    And then do a replace within this procedure only (CTRL+H) swapping "me" for wksTarget.

  11. #11
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to get a border to separate 'ID'?

    Hi MatrixMan,

    I didn't understand the instruction. I don't have any problem to put the code in sheet or standard module. Will you please attach a workbook with amended code for my better understanding and avoid any mistake from me please?

    Sorry for trouble.

    Thanking you.

  12. #12
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: How to get a border to separate 'ID'?

    If you send me the file with the code you're running I'll fix it for you.

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: How to get a border to separate 'ID'?

    Quote Originally Posted by mso3 View Post
    If the ‘ID’ in column ‘B’ is same then I want a serial number for only first ‘ID’ and the rest should be blank. I also want a thick horizontal border to separate ‘ID’. The require output is shown on the ‘output’ sheet.
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to get a border to separate 'ID'?

    Hi Matricman,

    Thank you for your kind concern about my problem.

    Hi Jindon,
    Thank you. It's working fine. Sorry to say that I have inserted 3 rows above it for company title and other information which I forgot to mention and show in the attached workbook in my previous post. Please will you do the amendment in the code to meet these new modification? Now instead of row 2 the first number starts from row 5 as shown in the attached workbook. I have attached the workbook for your perusal to amend the code.

    Sorry for trouble.

    Thank you to both of you and have a nice time.
    Attached Files Attached Files

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: How to get a border to separate 'ID'?

    Just change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and don't touch the rest like you did for Offset(, -4)

  16. #16
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to get a border to separate 'ID'?

    Hi Jindon,

    Perfect! Thank 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. Format .. Border .. I need a thicker border
    By Trebor777 in forum Excel General
    Replies: 1
    Last Post: 10-26-2016, 09:41 AM
  2. Remove border from legend entry without removing border from pie chart
    By cartman88 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-06-2015, 04:16 AM
  3. [SOLVED] Mysterious additional border to left of rows border?
    By Oppressed1 in forum Excel General
    Replies: 2
    Last Post: 10-10-2012, 03:22 PM
  4. Remove extra border and put all border in last row of generated output
    By cruise.alter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2012, 01:21 AM
  5. Replies: 1
    Last Post: 03-29-2011, 08:22 AM
  6. Replies: 2
    Last Post: 10-05-2005, 04:05 PM
  7. Replies: 0
    Last Post: 01-12-2005, 10:50 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