View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mindy Mindy is offline
external usenet poster
 
Posts: 25
Default Conditional formula

Sorry, to bother you again! But I am using the below code and it do not
work. Can you see where I went wrong? Thanks!

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 6 And _
Target.Value = "complete" Then
With Target.EntireRow
.Copy Destination:=Sheets("Completed Tasks") _
.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
.Hidden = True
End With
End If
enditall:
Application.EnableEvents = True
End Sub

"Gord Dibben" wrote:

I explained all that in the reply to your other post but maybe you lost track of
that because it was not your original post.

Right-click on the sheet tab and "View Code".

Copy/paste the code into that sheet module.

Edit to suit..........target.cells.column = 6 means column F

You must have a sheet named Completed or edit that also in the code.

Alt + q to return to your Excel sheet.

Enter "complete"(no quotes) in a cell in column F and that row will be copied to
the Completed sheet at next available row.


Gord

On Wed, 11 Jun 2008 03:59:01 -0700, Mindy
wrote:

Yes, that is exactly what I wanted it to do. However, I never had to run a
macro in excel, and I am not sure how or what is the best way to do it. Can
you walk me thru some steps? Thanks a bunch!

"Gord Dibben" wrote:

One other thing I should mention.

You can hide the "Completed" sheet and it will still be updated.


Gord

On Tue, 10 Jun 2008 14:41:06 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

You want the column to hide itself or the row to hide itself?

I would say the row to be hidden and copied

For the row hiding see your other posting that you tacked onto someone else's
original.

To both copy the row to another sheet and hide the row use this code.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 6 And _
Target.Value = "complete" Then
With Target.EntireRow
.Copy Destination:=Sheets("Completed") _
.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
.Hidden = True
End With
End If
enditall:
Application.EnableEvents = True
End Sub


Gord

On Tue, 10 Jun 2008 12:37:00 -0700, Mindy
wrote:

I have a main spreadsheet with 7 columns. (I have created a list to sort
through tasks, action officers, etc.) One of those columns is status. I
have put in drop down lists to pick the status ( complete, new, working..)
When Complete is selected I would like the column to hide itself and then
populated another sheet that has all the completed tasks(only) in it.

"Gord Dibben" wrote:

You mention a task sheet and a Main sheet.

"Pull" what to which "other sheet"

How will you know when the task is complete and which cells would be copied or
cut to the other sheet to be hidden?

Have you done this manually?

If so, maybe record a macro whilst doing it.

Or possibly event code to do it automatically when a certain cell turns to "task
complete".


Gord Dibben MS Excel MVP


On Tue, 10 Jun 2008 11:48:02 -0700, Mindy
wrote:

I have a task spreadsheet. When my task changes to complete I want to pull
to another sheet and hide it's view from the main sheet. Does anyone have
any suggestions?