View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DavidW[_15_] DavidW[_15_] is offline
external usenet poster
 
Posts: 1
Default 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