Solved

Excel: Hide extended content with VBA

Posted on 2011-09-13
6
381 Views
Last Modified: 2012-05-12
Hello, i'm using selection.value to write value in a cell.
The problem is the value is very long so it display over the next cells

as you can see on attached. But its strange that CELL E2 which also fill with long content can keep the extended content hidden.

how to solve this problem ?

display.jpg
0
Comment
Question by:veematics
6 Comments
 
LVL 8

Accepted Solution

by:
ragnarok89 earned 350 total points
ID: 36530328
Cell contents will overflow to the right if the cell on the right is blank. I can think of 3 fixes for this:

1. Right click cell, > Alignment > Wrap text
2. add a "space" to each of your blank cells
3. use merged cells to the right. text never flows over to a merged cell

Al
0
 
LVL 4

Expert Comment

by:SafetyFish
ID: 36530334
Excel only hides the extended text in a cell when the adjacent cell has a value in it. See in F2, there is a value written. Write some values in F3, F4, and F5 and see if that doesn't hide the extended content. Otherwise, you could also simply make the column wider. That  may or may not be practical for you, though.
0
 

Author Comment

by:veematics
ID: 36530385
@ragnarok89 , Right click cell, > Alignment > Wrap text <- can we do that with scripts (vba)
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 4

Expert Comment

by:SafetyFish
ID: 36530506
Yes. I think it goes:

RangeObject.Font.WrapText = True [or False]
0
 
LVL 4

Assisted Solution

by:SafetyFish
SafetyFish earned 150 total points
ID: 36530572
My bad, no need to put Font in there. It seems to work best as simply:

RangeObject.WrapText = True
0
 
LVL 5

Expert Comment

by:slycoder
ID: 36530644
This is just a cheating way of doing it -

You can hide that column, then insert a column that contains the summary of the hidden column.

1) Insert new column F (note this may change your macro references)
2) Starting at row 2 use the formula =LEFT(E2,10) change the #10 as needed
3) copy down as needed
4) hide column E

Hope this helps

0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get Started with Digital Signatures 4 24
Excel IF statement 4 24
Starting to use Git with Visual  Studio Online 1 26
Tricky Shapes formula 3 18
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question