Results 1 to 12 of 12

Thread: vertical title in excel cells

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Argentina, Buenos Aires
    Posts
    38

    Resolved vertical title in excel cells

    I use the code, for example :

    excelsheet.application.worksheets("myname').value="prod"
    with excelsheet.application.worksheets("myname").range("A1")
    .orientation=xlvertical
    end with

    and sometimes works : it gives p
    r
    o
    d



    and some others does nothing!!
    I feel I need the value of the constant xlvertical, but don't know how to find it. Once I needed the value of xlup and you gave it to me : -4162
    Furthermore what I really want is the result d
    o
    r
    p
    and the 4 lines nearer. Any help? Thanks
    Last edited by Norah; Mar 3rd, 2005 at 02:53 PM. Reason: RESOLVED

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: vertical title in excel cells

    Here is the value for the const. -
    VB Code:
    1. Const xlVertical = -4166
    So your saying that you want to reverse the cell contents and make it verticle?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Argentina, Buenos Aires
    Posts
    38

    Resolved rotated text in left side of cell in excel sheets

    The following code works O.K. : the texts in cells are rotated 90 degres as I wanted. But they appear at the righ(the end) of the cell and I want them at the left(the beggining of the cell) :

    with hoja.application.worksheets("produccion").range("A1:J1)
    .orientation=90
    end with

    I tried various codes including "alignment" in diferent contexts, but all failed!! Please, any help? Thanks.
    Last edited by Norah; Mar 2nd, 2005 at 08:34 AM. Reason: RESOLVED

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: rotated text in left side of cell in excel sheets

    What is the column formatted as? Text or numbers. Also, check you alignment formatting on the column.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Argentina, Buenos Aires
    Posts
    38

    rotated text in left side od cell in excel sheet

    I want the rotated text in a row, namely, ("A1:J1") . The row is all text
    Furthermore, I can do this in excel , directly by opening format, cells, alignment :90,alignment horizontal text: left, alignment vertical text: bottom. But, of course, I want to do it in a VB program.

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: vertical title in excel cells

    I fixed all your "New" threads as one thread. Please use the "Reply" button to reply to a posting.

    What code from VB do you have already? Can you post it?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Argentina, Buenos Aires
    Posts
    38

    Resolved Re: vertical title in excel cells

    The code I use is simply :

    with hoja.application.worksheets("produccion").range("A1:J1")
    .orientation=90
    end with

    The result is : the texts I had in cells A1 to J1, which were oriented horizontally, become vertical . This is O.K. Bue located at the right of each cell . I would like them at the left. Thanks for all !!
    Last edited by Norah; Mar 3rd, 2005 at 02:44 PM.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: vertical title in excel cells

    This should do it.
    VB Code:
    1. With hoja.Application.Worksheets("produccion").Range("A1:J1")
    2.         .HorizontalAlignment = xlLeft
    3.         .Orientation = 90
    4.         .VerticalAlignment = xlBottom
    5.         .WrapText = False
    6.         .AddIndent = False
    7.         .IndentLevel = 0
    8.         .ShrinkToFit = False
    9.         .ReadingOrder = xlContext
    10.         .MergeCells = False
    11.     End With
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Argentina, Buenos Aires
    Posts
    38

    Re: vertical title in excel cells

    Thanks. But I don't have the values of the constants involved in your code. Please,can you send them?

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: vertical title in excel cells

    You should have them if you added a reference to MS Excel xx.0 Object Library.
    VB Code:
    1. Const xlLeft = -4131
    2. Const xlBottom = -4107
    3. Const xlContext = -5002
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Argentina, Buenos Aires
    Posts
    38

    Smile Re: vertical title in excel cells

    Many, many thanks. It worked !!

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: vertical title in excel cells

    Your welcome

    Ps, dont forget to Resolve your thread as a courtesy to other members so
    they dont read the thread only to find its already solved.

    Instructions are in my signature.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width