Hi everyone,
I am stuck a little with something I just can't find the solution to in this forum.
I would like to:
1.) unhide a worksheet ("HELPERSHEET" in an open (and saved) workbook
2.) select a range from A3 to A62
3.) Copy the data in this range
4.) Paste this data into a .bat file
5.) Hide the "HELPERSHEET" work sheet
6.) Run the batch file.
In all of this I would not like the user to see that a workbook is being unhidden, so they don't start fiddling around with it. (screenupdate = false?).
This is what I have so far:
Sub sop_screenshot()
Dim LastRow As Integer
LastRow = ActiveSheet.Range("A62").End(xlUp).Row
Range("A3", "A62" & LastRow).Select
Selection.copy
Open ThisWorkbook.Path & "\sop_hotel_chceck.bat" For Output As #1
For NR = 1 To Selection.Rows.Count
For NC = 1 To Selection.Columns.Count
ExpData = Selection.Cells(NR, NC).Value
If IsNumeric(ExpData) Then ExpData = Val(ExpData)
If IsEmpty(Selection.Cells(NR, NC)) Then ExpData = ""
If NC <> NumCols Then
Print #1, ExpData
Else
Print #1, ExpData
End If
Next NC
Next NR
Close #1
End Sub
I am actually quite proud of what I got so far, and it works just perfect when run from the active work sheet, where my data used to reside prior to me wanting to hide it.
Any ideas? Do you need any further information?
Thanks a million,
Titus
Bookmarks