Hello everyone!

I'm new at the Excel macro thing, I am a VBScript dabbler though. I've been trying to adapt various Column and Row to CSV code snippets and its just not working the way I need. I have a feeling it is stopping when it hits a blank placeholder cell. Please help me

I have a spreadsheet used to generate data for a vendor application. I wanted it set up so that when my user clicks Cell A1, then all data from B3 to FG1000 (or wherever the rows stop) is placed in cells A3 through A-whatever in a semicolon-separated values list. The user will then be able to copy/paste the text string into a notepad to create a plain text file. I also need to have any column that is blank remain so, it should show up as ;; in the string.

The adapted code snippet I've been working off is here:


Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    If Target.Address = "$A$1" Then
 
        Dim Row As Integer
        Dim Column As Integer
        Dim Contents As String

        Row = 3
        Column = 2

        Do Until Cells(Row, Column).Value = ""
            If (Contents = "") Then
                Contents = Cells(Row, Column).Value
            Else
                Contents = Contents & ";" & Cells(Row, Column).Value
            End If
            Column = Column + 1
            Row = Row + 1
        Loop

        Cells(3, 1).Value = Contents

    End If
End Sub
Any help is greatly appreciated!

Thanks,

Oscar