if then multiple sheets and values

D

Danny

I use ms excel 2002. I have a workbook with multiple sheets. I want
a macro that will look at all active cells and specific values in one
column say column C in a worksheet1 and copy that cell and
corresponding A column cell to that C cell into another worksheet in
column A and C.

Example
Worksheet 1 if C1 value ="Value1" or "Value2" or "Value3" then copy
C1 and related field A1 from worksheet 1 to worksheet 2 fields C1 and
A1 respectively.

If it doesn't equal "Value1" or "Value2 " or "Value3" don't do
anything.

The macro needs to read worksheet 1 all active cells from C2 on ????



If this is not clear please post for clarifying

Thanks
D
 
J

Joel

NewRowCount = 1
for each sh in thisworkbook.sheets
for rowCount = 1 to 1000
if sh.range("A" & RowCount) = 5 and _
sh.range("B" & RowCount) = 10 then

sh.rows(rowcount).copy _
destination:=Sheets("Summary").Rows(NewRowCount)
NewRowCount = NewRowCount + 1
end if
next RowCount

next sh
 
D

Danny

NewRowCount = 1
for each sh in thisworkbook.sheets
   for rowCount = 1 to 1000
      if sh.range("A" & RowCount) = 5 and _
         sh.range("B" & RowCount) = 10 then

            sh.rows(rowcount).copy  _
              destination:=Sheets("Summary").Rows(NewRowCount)
            NewRowCount = NewRowCount + 1
      end if
   next RowCount

next sh










- Show quoted text -

Perfect thanks I will check out your code I really appreciate your
response.

D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top