Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Excel VBA .Find ignores commas

$
0
0

I have a code that searches for a value in column A. the values are project numbers like 4545 and 3605. Sometimes a project does have multiple sub-projects. A subproject is determined as example: 3605,01 and 3605,02 etc..

I use .find to find the row of the project and after it is found, some data is pasted.

The problem

Numbers like 4545 works perfectly but when a comma is used, Excel doesn't seems to get it. I think he sees a comma as a point. How can I let Excel know that a comma is the decimal separator? Or is there another problem?

This is my code:

    Dim Projectnumber As String
    Projectnumber = ActiveWorkbook.Sheets("Planning").Range("A6").Value2
    Dim ThisProjectRow As Range
    With Workbooks(Bureauplanner).Sheets("planning").Range("A:A")
        Set ThisProjectRow = .Find(What:=Projectnumber, LookIn:=xlValues, Lookat:=xlWhole, MatchCase:=False, Searchformat:=False)
            If Not ThisProjectRow Is Nothing Then
            End If
    End With

Viewing all articles
Browse latest Browse all 88854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>