Hi Roy,
I ended up using this code
Code
Sub GrabData()
Dim ReadRowCount As Long
Dim WriteRowCount As Long
Dim InputText As String
Dim ReadSheet As Worksheet
Dim WriteSheet As Worksheet
Set ReadSheet = ActiveWorkbook.Sheets(1)
Set WriteSheet = ActiveWorkbook.Sheets(2)
ReadRowCount = 2 'Do not count Headers
WriteRowCount = 2 ' Do not count Headers
While Len(ReadSheet.Range("A" & ReadRowCount).Value) > 0 ' must be text in column A
InputText = "object Host """ & ReadSheet.Range("A" & ReadRowCount).Value & """ {" & vbNewLine
InputText = InputText & "address = """ & ReadSheet.Range("B" & ReadRowCount).Value & """" & vbNewLine
InputText = InputText & "notes = """ & ReadSheet.Range("C" & ReadRowCount).Value & ", "
InputText = InputText & ReadSheet.Range("D" & ReadRowCount).Value & """" & vbNewLine
InputText = InputText & "import """ & "generic-host" & """" & vbNewLine
InputText = InputText & "vars.Type = """ & "Printer" & """" & vbNewLine
InputText = InputText & "check_command = """ & "hostalive" & """" & vbNewLine
InputText = InputText & "vars.snmp_printer [""" & "Toner" & """] = {snmp_printer_consum = """"}" & vbNewLine
InputText = InputText & "vars.snmp_printer [""" & "Messages" & """] = {snmp_printer_messages = """"}" & vbNewLine
InputText = InputText & "vars.snmp_printer [""" & "Pagecount" & """] = {snmp_printer_pagecount = """"}" & vbNewLine
InputText = InputText & "vars.snmp_printer [""" & "Trays" & """] = {snmp_printer_trays = """"}" & vbNewLine
InputText = InputText & "}"
WriteSheet.Range("A" & WriteRowCount).Value = InputText
ReadRowCount = ReadRowCount + 1
WriteRowCount = WriteRowCount + 1
Wend
End Sub
Display More
Which I have manged to get working now, the issue I am now having is the output on sheet 2 is fine, but when I copy and paste it adds additional "" to each line.
I then found some code on the web to remove and export the output to a txt file, but when I copy and paste it in to the program I am using it adds them again