LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Macro copied from ng returns a #VALUE!

The body of this macro was cut and pasted from this ng.
The only adjustment made was to change the cell to B2

When I try to run it, it puts #VALUE! in cell B2.
The file was saved (a number of times) prior to running the macro.
The cell was checked and it is formatted as "General".
What else can I check/change?

' WSNCOPY Macro
' From Dave Peterson

Dim wks As Worksheet
Dim myFormula As String

myFormula _
= "=MID(CELL(""filename"",a1),FIND(""]"",CELL(""filename"",a1))+1,255)"

For Each wks In ActiveWorkbook.Worksheets
With wks
.Range("B2").Formula = myFormula
End With
Next wks
End Sub

 
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
Macro for Insert/ Copied Cells Tami Excel Worksheet Functions 2 July 6th 09 05:37 AM
GETPIVOTDATA returns zero when copied to another sheet Frank Hayes[_3_] Excel Worksheet Functions 2 January 24th 09 10:16 PM
Copied formula produces unexpected copied results Robert New Users to Excel 1 December 5th 08 04:11 PM
EXCEL macro that will vary when copied Michael52 Excel Worksheet Functions 1 October 20th 07 11:15 PM
Macro to paste a copied range Ted[_7_] Excel Programming 2 December 26th 03 09:12 PM


All times are GMT +1. The time now is 07:27 AM.

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"