+ Reply to Thread
Results 1 to 11 of 11

diamond shaped in vba

  1. #1
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    diamond shaped in vba

    Hello All,


    Please help me to create below shape in excel sheet using VBA

    *
    **
    ***
    ****
    *****
    ****
    ***
    **
    *excel forum.pngexcel forum.xlsx
    Last edited by rishikrsaw; 06-08-2017 at 03:00 AM. Reason: attachment

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: diamond shaped in vba

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: diamond shaped in vba

    Or this: NOTE: Worksheet .png graphic added to Original Post AFTER this was written.
    Please Login or Register  to view this content.
    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-08-2017 at 09:11 AM.

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: diamond shaped in vba

    And just for fun, this does the WHOLE DIAMOND:
    Please Login or Register  to view this content.
    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-07-2017 at 11:02 AM.

  5. #5
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: diamond shaped in vba

    I want to * as below excel forum.pngexcel forum.png

  6. #6
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: diamond shaped in vba

    excel forum.png


    i WANT IN THIS FORMAT

  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: diamond shaped in vba

    Try:-
    Please Login or Register  to view this content.
    Regards Mick

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: diamond shaped in vba

    Or this, with a twist:
    Please Login or Register  to view this content.
    This WORKSHEET FORMULA could be used without VBA:

    =REPT("*",5-ABS(ROW()-8))

    ...where 5 is the maximum string length, and 8 is the row where it occurs. Row number must be greater than max. length.

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-08-2017 at 09:13 AM.

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

    Re: diamond shaped in vba

    Adding to leelnich code the border I think is required
    Please Login or Register  to view this content.
    Last edited by nigelog; 06-08-2017 at 08:47 AM.

  10. #10
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: diamond shaped in vba

    Just realized the range was off. If borders required, fold into same With block. (Nod to nigelog.)
    Please Login or Register  to view this content.
    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-08-2017 at 09:24 AM.

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

    Re: diamond shaped in vba

    Select the vertically consecutive cells and run the code.
    Please Login or Register  to view this content.

+ 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. bell - shaped curve
    By Grishag in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-30-2013, 04:18 PM
  2. Replies: 1
    Last Post: 07-10-2013, 04:24 PM
  3. Normal distribution shaped graph
    By pulsewidth in forum Excel Charting & Pivots
    Replies: 11
    Last Post: 05-25-2013, 10:18 AM
  4. S-Shaped Trendline - Please Help
    By veitch in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-31-2012, 09:40 AM
  5. [SOLVED] Blue diamond shape in a cell
    By tri_us in forum Excel General
    Replies: 0
    Last Post: 02-23-2006, 11:35 AM
  6. Is it possible to get Oval shaped Bubbles?
    By jennie in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-13-2006, 10:25 PM
  7. eliminate exclamation point in yellow diamond
    By Larry Smith in forum Excel General
    Replies: 7
    Last Post: 01-19-2006, 10:30 PM
  8. Excel L-shaped Text Box
    By pyongkim@gmail.com in forum Excel General
    Replies: 1
    Last Post: 12-13-2005, 06:35 PM

Tags for this Thread

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