LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default Copy And Paste Macro Syntax Problem

Greetings,

I found a solution to my copy and paste problem in the archives.

the problem is that I need to paste an empty cell as a choice in my IF
statement. Here is the formula in the cell called pfCell_1:

=IF(OFFSET(clStart,pfDisc,1)=0,"",OFFSET(clStart,p fDisc,1))

After I run the macro to overwrite the contents of the 79 named
ranges, this is what is returned in pfCell_1:

=IF(OFFSET(clStart,pfDisc,1)=0,,OFFSET(clStart,pfD isc,1))

Notice the missing "" marks.

Here is the macro that changes all 79 named ranges at one time:

Sub RecoverFormulas()
Dim i As Integer

With ActiveSheet
For i = 1 To 79
If Not i = 26 Then .Range("pfCell_" & i).Formula = _
"=IF(OFFSET(clStart,pfDisc," & i & _
")=0,,OFFSET(clStart,pfDisc," & i & "))"
Next i
End With

End Sub

When I tried to put "" between the ,,'s, debug kicked in and stopped
the macro with an error message - it did not like the ""'s !!!

How can This be rewritten so the I get empty named range if the result
is 0???

Any ideas, suggestions or thought on this matter?

Any help is appreciated.

-Minitman
 
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
Copy and paste problem Germano Excel Discussion (Misc queries) 1 August 24th 07 12:45 PM
Copy/ Paste Problem DanielSP Setting up and Configuration of Excel 4 January 25th 07 02:42 AM
Copy/Paste Problem Seti Excel Worksheet Functions 0 August 31st 06 05:10 PM
Copy and Paste Problem Skc Excel Discussion (Misc queries) 1 March 8th 06 07:21 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM


All times are GMT +1. The time now is 12:33 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"