Solved

Excel: Hide extended content with VBA

Posted on 2011-09-13
6
374 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
Comment Utility
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
Comment Utility
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
Comment Utility
@ragnarok89 , Right click cell, > Alignment > Wrap text <- can we do that with scripts (vba)
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 4

Expert Comment

by:SafetyFish
Comment Utility
Yes. I think it goes:

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

Assisted Solution

by:SafetyFish
SafetyFish earned 150 total points
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now