View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Need to copy rows in Sheet1 to different worksheets

Hi

Set ws1 = Sheets("Sheet1")

Sheets("Sheet1") is the sheet with the data
If the sheet with the data not exist you get a error 9


Use a range like this
Set rng = ws1.Range("A1:G100")

The names in the is example must be in column A
If not change this line
rng.Columns(1).AdvancedFilter _

To
rng.Columns(3).AdvancedFilter _
If the names are in column C




--
Regards Ron de Bruin
http://www.rondebruin.nl


"minx2001" wrote in message ...

I tried it and get the following error:

Run-time error '9' :
Subscript out of range

Please help (sorry about this, but as I said, I am completely new to
this).

Thanks


--
minx2001
------------------------------------------------------------------------
minx2001's Profile: http://www.excelforum.com/member.php...o&userid=15168
View this thread: http://www.excelforum.com/showthread...hreadid=271761