View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Select rows and copy to another sheet.

Hi Juan

Filter your column
http://www.rondebruin.nl/copy5.htm

Change the range and sheet name in the code



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



"Juan" wrote in message ...
Hello Ben,
thanks but not working. I copied code and when I run get
message saying Object required and it highllights the
For m = 1 To actsh.UsedRange.Rows.Count line
So not sure if you have any other ideas?

appreciate any other help.

thanks,

juan
-----Original Message-----


sub runme()
set actsh = activesheet
set shcopyto = sheet2 ' or your sheet name here
k = 1
for m = 1 to actsh.usedrange.rows.count
if cells(m,1).value = "Total" then
rows(trim(str(m))).copy
shcpyto.activate
cells(k,1).select
activesheet.paste
k = k+1
end if
next
end sub


"Juan" wrote:

Hi there,
In column A I have some rows with the word Total. I

want
to select those rows and copy to another worksheet
starting in A2.
I been trying to modify some code but without

success.
Can anyone provide some info on this?
Appreciate all the help.

Thanks,

Juan

.