View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default The sheet name to copy to is in column H of the If Statement row

Having trouble making shtTo be the sheet name to copy to in the If
statement. Where the names in column H are an actual sheet name, (in
this case a persons name) Ted, Allen, Kelly etc.

Thanks,
Howard


Sub Column_Check_OneRng()

Dim rngB As Range
Dim OneRng As Range
Dim shtTo As Worksheet

Application.ScreenUpdating = False

Set OneRng = Sheets("Bid log").Range("A2:A" & Cells(Rows.Count,
"A").End(xlUp).Row)

For Each rngB In OneRng

If rngB.Offset(, 3) = "D-Col Bid" Then
'set shtTo to the name in column H which is a sheet name to
copy to shtTo.Range("B" & Rows.Count).End(xlUp)(2) = rngB

End If

Next

Application.ScreenUpdating = True

End Sub


shtTo is an object that *must* be initialized via a 'Set' statement!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion