Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy data from one sheet to another when criteria met in column

Status
Not open for further replies.

born2program

Technical User
Sep 18, 2006
85
US
I need some direction on writing VBA code that will do the following in Excel. When I put a value in column 2 on sheet1, If the value = "A" then have it show on sheet 2.

Thanks.
 
hi
this is probably best placed in the vba forum (
however, even there some more info might be required such as do you want your input figure to be transferred to the second sheet or some other data in the same column/row?

as a rough guide i'd start in the worksheet change event with

if not intersect(target, columns(2)) is nothing and target.value = "A" then
worksheets("sheet2").range("some range") = target
end if

this probably won't work as is but will give you a starter.

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
hi
this is probably best placed in the vba forum (
however, even there some more info might be required such as do you want your input figure to be transferred to the second sheet or some other data in the same column/row?

as a rough guide i'd start in the worksheet change event with

if not intersect(target, columns(2)) is nothing and target.value = "A" then
worksheets("sheet2").range("some range") = target
end if

this probably won't work as is but will give you an idea of what you might need.

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 



Hi,

Please post VBA questions in forum707.

What are you trying to accomplish? (The answer is NOT merely a restatement of your initial question, it involved the REASON you need to do this)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks for the input. I have posted this in the VBA forum. What I have is a sheet with an ALL tab and then tabs for individual departments. In the ALL tab if I put a department name in column 2 lets say department is "A" then I want it to show on the Department A tab, if "B" then show on the Department B tab and so on.
 



Why not just use the AutoFilter? Make a helper column =LEFT(A2,1) where column A is your Department. Then filter on this new column. EASY PEASY!!!

It often NOT a very good idea to chop similar data up into separate tables.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top