+ Reply to Thread
Results 1 to 11 of 11

AutoFit Rows according to VISIBLE COLUMNS

  1. #1
    Forum Contributor
    Join Date
    09-28-2019
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    147

    AutoFit Rows according to VISIBLE COLUMNS

    Hello guys

    I've a data Base which i make some hidden columns to PRINT PDF, although i want now to autofit ROWS according to Columns Visible

    I found this on the internet, although i cannot make this to work

    My first data is on A9 (row and column)
    Sheet name is "BD CLIENTES"


    Please Login or Register  to view this content.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: AutoFit Rows according to VISIBLE COLUMNS

    what exactly is NOT working? that's all you said. and to me, this doesn't make a lot of sense the way it is written:

    although i want now to autofit ROWS according to Columns Visible

  3. #3
    Forum Contributor
    Join Date
    09-28-2019
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    147
    Quote Originally Posted by vba_php View Post
    what exactly is NOT working? that's all you said. and to me, this doesn't make a lot of sense the way it is written:
    Hi,

    It is does not autofit according to visible columns.

    Imagine you have text:
    COLUNN A:
    "XPTO"

    COLUNN B:
    "XPTO
    XPTO
    XPTO"

    COLUNN C:
    "XPTO
    XPTO"

    If i hide column B It should autofit rows according to text on C column instead of hidden B

  4. #4
    Forum Contributor
    Join Date
    09-28-2019
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    147

    Re: AutoFit Rows according to VISIBLE COLUMNS

    Hello guys

    Can anyone help me out?

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: AutoFit Rows according to VISIBLE COLUMNS

    why would one be able to fit rows to AUTOFIT based on what columns are visible and not visible? that makes no sense, right? a column is not a row. and hiding columns has nothing to do with autofitting rows so multi-line cells can reveal all of their text in terms of visibility.
    i know you found that code on the internet, but did you try recording your actions with the macro recorder and just using that?

  6. #6
    Forum Contributor
    Join Date
    09-28-2019
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    147

    Re: AutoFit Rows according to VISIBLE COLUMNS

    Ofc i did by myself but doesn't work when recording a macro

    You can check file attached. Even with Column B hiden, when autofitting it consideres column B height
    Attached Files Attached Files

  7. #7
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: AutoFit Rows according to VISIBLE COLUMNS

    oh, now I get it! I don't think you can do it. and the reason => a row is a row and a column is a column. rows and columns intersect, and rows have every column of data associated with them regardless of whether they are hidden or not. and I'm not an excel pro, but it sounds right to me. what about workarounds?

    first of all, why do you even have data like this? surely there is a better way to store it, right? the other thing you could obviously do as a workaround, would be to store the hidden col data in another sheet, print the PDF-based sheet, then cut the external data and paste it in back where it was before the printing. that would obviously work.

  8. #8
    Forum Contributor
    Join Date
    09-28-2019
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    147

    Re: AutoFit Rows according to VISIBLE COLUMNS

    Yes must probably it would work to copy visible columns and rows to another sheet and then autofit

    But how can i do that? xD

  9. #9
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: AutoFit Rows according to VISIBLE COLUMNS

    you do it like this, mr. beginner: ()
    Please Login or Register  to view this content.
    almost all of that was taken by the recorder. now, I started it. you can finish it.

  10. #10
    Forum Contributor
    Join Date
    09-28-2019
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    147

    Re: AutoFit Rows according to VISIBLE COLUMNS

    Got it, have a great day

  11. #11
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: AutoFit Rows according to VISIBLE COLUMNS

    cool! l..................

+ 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. Wordwrap preventing autofit rows/columns.
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2016, 04:01 PM
  2. [SOLVED] Only small portion of rows and columns are visible
    By jmoffett in forum Excel General
    Replies: 4
    Last Post: 06-18-2014, 02:16 PM
  3. Use visible rows from autofilter to build Pivot table. Or use visible rows to Copy/Paste
    By mwhitedesigns in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 10:34 AM
  4. AutoFit Without knowing specific Rows & Columns
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2010, 02:10 PM
  5. Resize Visible Rows based only on Visible Columns text
    By Zimbo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2009, 10:55 AM
  6. AutoFit on visible data only
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-04-2007, 06:30 PM
  7. autofit only visible columns
    By Testtest in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2005, 10:20 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