#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default R/T 438

The below code is bombing on line:
v = Application.WorksheetFunction.Left(v, Len(v) - 1)

Not sure if the later two lines will work or not

Sub tester()
Dim v As String
Dim Rng As Range
Set Rng = Range("A2:A16")
For Each cell In Rng
If cell.Value = "9/15/2006" Then
v = v + cell.Address & ","
End If
Next
'need to remove the last "," assigned to my v next
v = Application.WorksheetFunction.Left(v, Len(v) - 1)
Set Rng1 = Range(v)
Rng1.Entirerow.select
End Sub

Any help appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default R/T 438

Omit WorksheetFunction! VBA has its own LEFT function!

Regards,
Stefi


€˛Jim May€¯ ezt Ć*rta:

The below code is bombing on line:
v = Application.WorksheetFunction.Left(v, Len(v) - 1)

Not sure if the later two lines will work or not

Sub tester()
Dim v As String
Dim Rng As Range
Set Rng = Range("A2:A16")
For Each cell In Rng
If cell.Value = "9/15/2006" Then
v = v + cell.Address & ","
End If
Next
'need to remove the last "," assigned to my v next
v = Application.WorksheetFunction.Left(v, Len(v) - 1)
Set Rng1 = Range(v)
Rng1.Entirerow.select
End Sub

Any help appreciated.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"