Private Sub sh05_print_Click()
Call unlocksheet
'to export data to csv -- ends with calling the 'clear' sub
Dim TextFile As Integer
Dim FilePath As String
Dim record_num As Integer
Dim record_count As Integer
Dim column_num As Integer
record_count = Range("aa4").Value
FilePath = "C:\Bartender Commander Folder\SH_05_PART_LABELS.csv"
TextFile = FreeFile
Open FilePath For Output As TextFile
For record_num = 1 To record_count
For column_num = 1 To 8
If column_num = 8 Then
Write [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=TextFile]#TextFile[/URL] , Range("aa7:af10").Cells(record_num, column_num).Value
Else
Write [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=TextFile]#TextFile[/URL] , Range("aa7:af10").Cells(record_num, column_num).Value,
End If
Next column_num
Next record_num
Close TextFile
Call locksheet
Call sh05clear_Click
End Sub