AnthonyMinnaar
New Member
- Joined
- Aug 25, 2020
- Messages
- 28
- Office Version
- 2013
- Platform
- Windows
hi Folks,
I'm trying to make a post for a Fanuc milling machine. I've got most of it working now, except for one thing. The problem are the tabs behind the lines when exported to .TAP, the machine cant read these tabs. Is there an option to add to the code below so it leaves out these tabs? (I know, it's a huge mess, but it does the job. I can't write code myself, but I do know how to copy/paste, hence the chaotic code).
[Sub POSTB()
Sheets("PROGRAMMA").Select
Columns.EntireColumn.Hidden = False
Rows.EntireRow.Hidden = False
For Each c In Range("A1:A70")
If c.Value = "" Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next
Dim wb As Workbook
Dim saveFile As String
Dim WorkRng As Range
On Error Resume Next
Set WorkRng = Worksheets("PROGRAMMA").Range("A1:G68")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb = Application.Workbooks.Add
WorkRng.SpecialCells(xlCellTypeVisible).Copy
wb.Worksheets(1).Paste
saveFile = Application.GetSaveAsFilename(fileFilter:="TAP (*.TAP), *.TAP")
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Sheets("INVULSHEET").Select
End Sub]
I'm trying to make a post for a Fanuc milling machine. I've got most of it working now, except for one thing. The problem are the tabs behind the lines when exported to .TAP, the machine cant read these tabs. Is there an option to add to the code below so it leaves out these tabs? (I know, it's a huge mess, but it does the job. I can't write code myself, but I do know how to copy/paste, hence the chaotic code).
[Sub POSTB()
Sheets("PROGRAMMA").Select
Columns.EntireColumn.Hidden = False
Rows.EntireRow.Hidden = False
For Each c In Range("A1:A70")
If c.Value = "" Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next
Dim wb As Workbook
Dim saveFile As String
Dim WorkRng As Range
On Error Resume Next
Set WorkRng = Worksheets("PROGRAMMA").Range("A1:G68")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb = Application.Workbooks.Add
WorkRng.SpecialCells(xlCellTypeVisible).Copy
wb.Worksheets(1).Paste
saveFile = Application.GetSaveAsFilename(fileFilter:="TAP (*.TAP), *.TAP")
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Sheets("INVULSHEET").Select
End Sub]