Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default cell.formula fails

Hi All:

I'm transforming some Excel data into Word tables. I'm quite familiar
with Word VBA but having some difficulty with Excel. (This inexperience
may explain why I feel Excel's VB is flakier than Word's.)

One problem I've just encountered is this test:

for each acell in myrange.cells
if acell.formula="" then acell.value = " "
next acell

That is, empty cells have a blank inserted in them. I do this because
if you copy a range from Excel to Word, empty cells are omitted from
the Word table, leading to a real mess.

The comparison fails with a 1004 error after some time. Examination of
the cell shows it contains about 20 lines of text, otherwise
unremarkable.

Any suggestions?
Garry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cell.formula fails

Dim rng as Range
On Error Resume Next
set rng = myrange.SpecialCells(xlBlanks")
On Error goto 0
if not rng is nothing then
rng.Value = " "
End if

--
Regards,
Tom Ogilvy


"Garry" wrote in message
oups.com...
Hi All:

I'm transforming some Excel data into Word tables. I'm quite familiar
with Word VBA but having some difficulty with Excel. (This inexperience
may explain why I feel Excel's VB is flakier than Word's.)

One problem I've just encountered is this test:

for each acell in myrange.cells
if acell.formula="" then acell.value = " "
next acell

That is, empty cells have a blank inserted in them. I do this because
if you copy a range from Excel to Word, empty cells are omitted from
the Word table, leading to a real mess.

The comparison fails with a 1004 error after some time. Examination of
the cell shows it contains about 20 lines of text, otherwise
unremarkable.

Any suggestions?
Garry



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
Excel formula fails to update barry Excel Discussion (Misc queries) 1 September 17th 06 12:44 PM
Formula fails in text formatted cell kennoc Excel Worksheet Functions 2 May 3rd 06 12:36 AM
Setting a cell equal to another worksheet cell fails (sometimes) Richard Excel Worksheet Functions 2 March 10th 06 04:11 AM
VBA Formula Fails to Execute Patrice Stewart Setting up and Configuration of Excel 1 August 24th 05 09:45 PM
updating range value via knowledbase 278973 fails when cell contains formula Ian Ornstein Excel Programming 1 January 29th 04 10:24 AM


All times are GMT +1. The time now is 12:57 PM.

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

About Us

"It's about Microsoft Excel"