#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Autofill

Hi,

I have a table in sheet A with fields
like "plan","user","date","amt". Now I need copy this
table to sheet B with only 2 fields, they'
re "user","date". Plus I want to only copy the records
with user name "Smith" and "Ami". Can anyone tell me how
should I program this in my VB code ? Appreciate any
help.
Thanks

Meme
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Autofill

Have you tried using the advanced filter function? You
could use the advanced filter to return only the desired
records and then copy the results to sheet B.

The advanced filter code would be:

Range("B3:E9").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Range( _
"H3:H5"), CopyToRange:=Range("J3:K3"),
Unique:=False

Hope this helps,
Raul


-----Original Message-----
Hi,

I have a table in sheet A with fields
like "plan","user","date","amt". Now I need copy this
table to sheet B with only 2 fields, they'
re "user","date". Plus I want to only copy the records
with user name "Smith" and "Ami". Can anyone tell me how
should I program this in my VB code ? Appreciate any
help.
Thanks

Meme
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Autofill

You can use an Advanced Filter to extract the fields to another
worksheet. Set up a criteria range, with headings that match the
headings in your table, e.g.:

user
Smith
Ami

There are instructions here for filtering to another worksheet:

http://www.contextures.com/xladvfilter01.html#ExtractWs

Meme wrote:
I have a table in sheet A with fields
like "plan","user","date","amt". Now I need copy this
table to sheet B with only 2 fields, they'
re "user","date". Plus I want to only copy the records
with user name "Smith" and "Ami". Can anyone tell me how
should I program this in my VB code ? Appreciate any
help.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Autofill

Thanks, this helps me out too.

Raul
-----Original Message-----
You can use an Advanced Filter to extract the fields to

another
worksheet. Set up a criteria range, with headings that

match the
headings in your table, e.g.:

user
Smith
Ami

There are instructions here for filtering to another

worksheet:


http://www.contextures.com/xladvfilter01.html#ExtractWs

Meme wrote:
I have a table in sheet A with fields
like "plan","user","date","amt". Now I need copy this
table to sheet B with only 2 fields, they'
re "user","date". Plus I want to only copy the records
with user name "Smith" and "Ami". Can anyone tell me

how
should I program this in my VB code ? Appreciate any
help.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Autofill

You're welcome! And if you turn on the macro recorder while filtering,
you'll get most of the code you need to run the filter automatically.

Raul wrote:
Thanks, this helps me out too.

Raul

-----Original Message-----
You can use an Advanced Filter to extract the fields to


another

worksheet. Set up a criteria range, with headings that


match the

headings in your table, e.g.:

user
Smith
Ami

There are instructions here for filtering to another


worksheet:



http://www.contextures.com/xladvfilter01.html#ExtractWs

Meme wrote:

I have a table in sheet A with fields
like "plan","user","date","amt". Now I need copy this
table to sheet B with only 2 fields, they'
re "user","date". Plus I want to only copy the records
with user name "Smith" and "Ami". Can anyone tell me


how

should I program this in my VB code ? Appreciate any
help.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



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
Autofill fretburn Excel Discussion (Misc queries) 5 November 3rd 09 09:23 PM
autofill grambo Excel Discussion (Misc queries) 1 October 9th 06 02:55 AM
autofill Jimmy Excel Discussion (Misc queries) 2 May 31st 06 07:35 PM
Autofill Dolphinv4 Excel Discussion (Misc queries) 2 October 21st 05 12:34 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM


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