Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using ActiveCell to specify a column
In the code below I am stepping through all the cells on the workshee "Master" and moving certain rows to a worksheet "Complete". Only th rows that have a value in the H column called "Comp Date" will be move to the other sheet. How would I specify the column in my If statemen below? This line is incorrect - If sourceRange.Column(Comp Date). Tha should give you an idea of what I need. Code ------------------- Dim Bcell As Range Dim sourceRange As Range Dim destrange As Range Dim Lr As Long ' I omitted some code that works For Each Bcell In Worksheets("Master").Range("A2", LastCell) Set sourceRange = ActiveCell.EntireRow ' the following line is wrong - it needs to refer to column H /Comp Date If sourceRange.Column(Comp Date) < "" Then 'this line is wrong Set destrange = Sheets("Complete").Rows(Lr + 1) sourceRange.Copy destrange sourceRange.EntireRow.Delete End If Next Bcel ------------------- Thanks for any help -- David ----------------------------------------------------------------------- DavidW's Profile: http://www.excelforum.com/member.php...fo&userid=3263 View this thread: http://www.excelforum.com/showthread.php?threadid=57427 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Set ActiveCell at the first column of the same row... | Excel Discussion (Misc queries) | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
activecell column to a given range | Excel Programming | |||
How to set ActiveCell to a new column? | Excel Programming | |||
Find ActiveCell.column | Excel Programming |