SOLVED

Excel Data Streamer reading cells

Copper Contributor

Hello there

 

I seem to be struggling with something very basic, however I cant find any info to help me.

 

I'm simply trying to read values from different cells via my Arduino. 

 

E.g.    Read number in cell A1 --> get response via Arduino (true/false) --> Read next cell A2 --> etc.

 

The project is just SMSing different cell phone numbers from a list in excel, and waiting for a response to test if they are still active.

 

Any help would really be appreciated.

 

Thanks

Nick

 

3 Replies
best response confirmed by allyreckerman (Microsoft)
Solution

@NTolken Maybe this is a step in the right direction? You will have to change to your Arduino function that I am not familiar with and thus inserted a place holder returning true or false.

Sub testNumbers()
    For Each cell In Range("a:a")
        'test conditions
        If cell.Row > Range("a1").SpecialCells(xlCellTypeLastCell).Row Then
            'done
            Exit For
        ElseIf cell.Value = "" Then
            'do nothing
        Else
            'apply your code
            cell.Offset(0, 1).Value = arduino(cell.Value)
        End If
    Next cell
End Sub


Function arduino(number As String)
    If number > 200 Then   'your code here
        arduino = True
    Else
        arduino = False
    End If
End Function

  

@bosinander 

 

Sorry for taking so long to reply! Thank you very much for your help, its really appreciated. This will take some time xD

@NTolken You're welcome :) Good luck!

1 best response

Accepted Solutions
best response confirmed by allyreckerman (Microsoft)
Solution

@NTolken Maybe this is a step in the right direction? You will have to change to your Arduino function that I am not familiar with and thus inserted a place holder returning true or false.

Sub testNumbers()
    For Each cell In Range("a:a")
        'test conditions
        If cell.Row > Range("a1").SpecialCells(xlCellTypeLastCell).Row Then
            'done
            Exit For
        ElseIf cell.Value = "" Then
            'do nothing
        Else
            'apply your code
            cell.Offset(0, 1).Value = arduino(cell.Value)
        End If
    Next cell
End Sub


Function arduino(number As String)
    If number > 200 Then   'your code here
        arduino = True
    Else
        arduino = False
    End If
End Function

  

View solution in original post