Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Getting text to overlap into other cells

One of the nice things about xl is that text in a cell will overlap
into the next cell if there's nothing there, rather than be "cut off".
Unfortunately in my spreadsheet this isn't working...

The spreadsheet in question is generated in code. The code first
builds a huge table of data from SQL, and pastes it into columns
starting at BA, which it then hides. The columns the user sees, A
through T currently, are then built by inserting formulas that copy
the data. To save recalc time I then copy and pastevalues any of the
columns that cannot change, which is about half of them. I use
formulas instead of copying and pasting them directly because there's
a small bit of logic that has to be applied to each row, and it SEEMS
that a formula is much faster than looping over them.

Anyway, the A column is sparsely populated text, some of which is
long. If there is text in that column, the formula means there is no
text in B. Yet the text in A is NOT overlapping the cell boundary into
B.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Getting text to overlap into other cells

The formulas in column B mean that the cell isn't blank even if the formula
result is "".

You might have to run a loop on column B with the code:

if range("Bx").value = "" then range("Bx").value = ""

Which I know seems like it won't do anything but it will actually remove the
formulas where they return blanks.


"Maury Markowitz" wrote:

One of the nice things about xl is that text in a cell will overlap
into the next cell if there's nothing there, rather than be "cut off".
Unfortunately in my spreadsheet this isn't working...

The spreadsheet in question is generated in code. The code first
builds a huge table of data from SQL, and pastes it into columns
starting at BA, which it then hides. The columns the user sees, A
through T currently, are then built by inserting formulas that copy
the data. To save recalc time I then copy and pastevalues any of the
columns that cannot change, which is about half of them. I use
formulas instead of copying and pasting them directly because there's
a small bit of logic that has to be applied to each row, and it SEEMS
that a formula is much faster than looping over them.

Anyway, the A column is sparsely populated text, some of which is
long. If there is text in that column, the formula means there is no
text in B. Yet the text in A is NOT overlapping the cell boundary into
B.

Any ideas why?

Maury

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Getting text to overlap into other cells

On Jun 16, 11:02*am, Sam Wilson
wrote:
The formulas in column B mean that the cell isn't blank even if the formula
result is "".


But I pastevalues over the columns, and there's nothing in the empty
ones. It's not that they are blank, they really are empty. Or at least
the empty string, "".

Maury

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Getting text to overlap into other cells

On further reflection I'm not sure what I said is different than what
you said. So let me get specific.

First I do this...

ActiveSheet.Range("T5:T" & lastRow).formula =
"=IF(ET5=1,EP5+ES5,"""")"

then I do this...

ActiveSheet.Range("T5:T" & lastRow).Copy
ActiveSheet.Range("T5:T" & lastRow).PasteSpecial xlPasteValues

So in this case, is there anything left in the cell?

Maury
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Getting text to overlap into other cells

Well for what it's worth...

ast.Range("A5:T" & lastRow).PasteSpecial xlPasteValues,
SkipBlanks:=True

did not fix the problem. :-(

Maury


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Getting text to overlap into other cells

You need to explicitly tell excel that the cell value is "", so you need to
use something like

for i = 0 to 999
if Range("b1").offset(i,0).value = "" then Range("b1").offset(i,0).value =
""
next i

which is different to pasting values over all cells.

I've tried it by puting "aaaaaaaaaaaaaaaaaaaaaaaaaa" in A1, and ="" in B1
which won't let the text from A1 spill over, but after running the above
macro it does.

Sam

"Maury Markowitz" wrote:

Well for what it's worth...

ast.Range("A5:T" & lastRow).PasteSpecial xlPasteValues,
SkipBlanks:=True

did not fix the problem. :-(

Maury

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default macro help

For those of us who are trying to do exactly what you are trying to do (let values of previous cells overlap cells with formulas that result in "") but don't know much of anything about creating macros, would you be willing to give some details about how you set this up? I've tried using what you said below and am failing miserably. thanks
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default macro help

Pardon me if this is here twice but it shows I never posted this. I am not good at creating macros (don't know the language but have successfully done a couple with good instructions from others). I am trying to do exactly what is explained below. that is, I need to have a cell overlap the next cells in line when the next cells in line result in "" (from a formula). Can you give explicit instructions on how to create what you are explaining below? thanks
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default macro help

Dan,

The bit explained below isn't, i.e. we have no idea what you want that macro
to do.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

<Dan C wrote in message ...
Pardon me if this is here twice but it shows I never posted this. I am not
good at creating macros (don't know the language but have successfully
done a couple with good instructions from others). I am trying to do
exactly what is explained below. that is, I need to have a cell overlap
the next cells in line when the next cells in line result in "" (from a
formula). Can you give explicit instructions on how to create what you are
explaining below? thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force text to overlap Aled Davies Setting up and Configuration of Excel 3 April 7th 23 12:23 PM
I would like text to overlap adjacent cell(s) Mike Excel Discussion (Misc queries) 3 December 16th 19 06:45 PM
Overlap Cells Vertically without Merging Muffi Zainu[_2_] Excel Discussion (Misc queries) 2 December 8th 09 09:37 AM
overlap printing riven Excel Discussion (Misc queries) 1 May 14th 09 12:46 PM
DataLabel Overlap Stan Charts and Charting in Excel 0 April 30th 07 03:40 AM


All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"