Reference cell in previous worksheet to then add +1 for serial pag

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to print a serial number on previously printed gift cards. The gift
cards are printed 2-up on 8.5x11 stock. I thought I could create a 50 sheet
workbook and print 100 cards at a time by printing the workbook, using my
card stock in my printer tray. Am wondering if there is a way to reference
the cell in the preceeding worksheet, then add a +1 value.
 
Using the Cells method in VBA:

Cells(1+1,1) moves one row down.

Cells(1,1+1) moves one column to the right

Cells(2-1,1) moves one row up.

Cells( 2,2-1) moves one column to the left.
 
You sure can, without knowing the cell or its contents, i can't be exact but
if the last cell is on sheet1 column A cell 10 then wherever you want the
answer:
=Sheet1!A10+1

change Sheet1! to the sheets name and A10 to the cell that its in.
 
I am trying to find if there is a value/function that references a cell on a
previous worksheet. In other words, if assuming there is a value (say 232)in
Worksheet 1, Cell F23, that I wish to appear in Worksheet 2 as the value 233,
I know how to program WORKSHEET1!F23+1, but if I wanted to copy that formula
across a 50 sheet workbook, do I need to type in each Worksheet# on each
page, or is there a value that equals a reference to the previous worksheet,
i.e: (PreviousWorkSheet#!F23+1)
 
Thank you for your response. I do understand what you are saying. Pasted
below is my response to another reply:

I am trying to find if there is a value/function that references a cell on
a previous worksheet. In other words, if assuming there is a value (say
232)in Worksheet 1, Cell F23, that I wish to appear in Worksheet 2 as the
value 233, I know how to program WORKSHEET1!F23+1, but if I wanted to copy
that formula across a 50 sheet workbook, do I need to type in each Worksheet#
 
thames
write a small routine
something like this
sub x()
dim asheet ,bsheet dim x
x= thisworkbook.worksheets.count
for n= 1 to x
worksheet(n).activate
'your print command here
asheet= worksheet(n).range(f,10) =====change
next n
the code is not complete
but u will get an idea
 
Try this UDF, in a module.
Then you can enter
=GetThisCellOnPrevWS
in any cell.

Public Function GetThisCellOnPrevWS() As Variant
Dim ThisWSIndex As Long

Application.Volatile

ThisWSIndex = Application.Caller.Parent.Index

If ThisWSIndex > 1 Then
GetThisCellOnPrevWS = Worksheets(ThisWSIndex -
1).Range(Application.Caller.Address)
Else
GetThisCellOnPrevWS = "First WS"
End If

End Function

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top