[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Excel: Hide extended content with VBA

Posted on 2011-09-13
6
Medium Priority
?
400 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Accepted Solution

by:
ragnarok89 earned 1400 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 600 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

656 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