Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel formula fails to update | Excel Discussion (Misc queries) | |||
Formula fails in text formatted cell | Excel Worksheet Functions | |||
Setting a cell equal to another worksheet cell fails (sometimes) | Excel Worksheet Functions | |||
VBA Formula Fails to Execute | Setting up and Configuration of Excel | |||
updating range value via knowledbase 278973 fails when cell contains formula | Excel Programming |