Print To WorkSheet

  • Thread starter Thread starter open a adobe file from a command button
  • Start date Start date
O

open a adobe file from a command button

The person that wrote this code is no longer around. It works great in the
immediate window. My question is what do I do to get it to print onto a
worksheet?

Thank You

Sub bill()
'Dim varibles
Dim xx As Integer
Dim Row As Integer
Dim Unit As Integer
Dim Shelf As Integer
Dim Position As Integer
Dim Rowcounter As Integer
Dim Unitcounter As Integer
Dim Shelfcounter As Integer
Dim Positioncounter As Integer

'Set varibles starting number
Row = 1
Unit = 1
Shelf = 1
Position = 0
Rowcounter = 1
Unitcounter = 1
Shelfcounter = 1
Positioncounter = 1
xx = 0

Do While xx <= 50
xx = xx + 1
Position = Position + 1

If Position = 6 Then
Shelf = Shelf + 1
Position = 1
End If



Debug.Print " Row is " & Row & _
" Unit is " & Unit & _
" Shelf is " & Shelf & _
" Position is " & Position

Loop
End Sub
 
Replace this section ......

Debug.Print " Row is " & Row & _
" Unit is " & Unit & _
" Shelf is " & Shelf & _
" Position is " & Position

with this.........

With Sheets("Sheet1")
.Cells(xx, 1) = "Row is " & Row
.Cells(xx, 2) = "Unit is " & Unit
.Cells(xx, 3) = "Shelf is " & Shelf
.Cells(xx, 4) = "Position is " & Position
End With

--

Regards,
Nigel
(e-mail address removed)



"open a adobe file from a command button"
 
That Works great!
Thank You very Much!!

Nigel said:
Replace this section ......

Debug.Print " Row is " & Row & _
" Unit is " & Unit & _
" Shelf is " & Shelf & _
" Position is " & Position

with this.........

With Sheets("Sheet1")
.Cells(xx, 1) = "Row is " & Row
.Cells(xx, 2) = "Unit is " & Unit
.Cells(xx, 3) = "Shelf is " & Shelf
.Cells(xx, 4) = "Position is " & Position
End With

--

Regards,
Nigel
(e-mail address removed)



"open a adobe file from a command button"
 
Back
Top