Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default one more macro question

ok, so this macro is working great..

Sub CopyToSheetz()

Dim rng As Range
Dim oCell As Range

Set rng = Range("B4:B" & Cells(Rows.Count, "B").End(xlUp).Row)
For Each oCell In rng
oCell.EntireRow.Copy _
Destination:=Sheets(oCell.Value).Range("A65536").E nd(xlUp).Offset(1,
0)
Next oCell


End Sub
-----

except, i have this formula in my B column

=IF(A4="","",IF(ISERROR(VLOOKUP(A4,'Names
List'!$A$5:$E$5000,2,FALSE)),"NA",VLOOKUP(A4,'Name s
List'!$A$5:$E$5000,2,FALSE)))

so when the macro gets to the lines that have the "" in it, i get a syntax
error. Can someone help me get around this? I dont need these lines copied, I
just wanetd to get rid of the #N/A if A is blank.
Any help would be great..

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
Macro Question David Excel Discussion (Misc queries) 3 April 30th 10 02:25 PM
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Macro question rmcove Excel Discussion (Misc queries) 5 March 5th 09 03:01 PM
Macro Question carl Excel Worksheet Functions 0 June 7th 06 06:14 PM
Macro Question sony654 Excel Worksheet Functions 3 February 27th 06 09:55 PM


All times are GMT +1. The time now is 10:20 PM.

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"