[Dba-office] Referencing previous sheet in Excel

Gustav Brock gustav at cactus.dk
Sun Dec 21 12:58:51 CST 2014


Hi Susan

In code it would be something like:

Set wksCurrent = current worksheet
Set wksPrevious = WorkSheets(wksCurrent.Index - 1)

I guess similar things can be done with a formula.

/gustav

________________________________________
Fra: dba-office-bounces at databaseadvisors.com <dba-office-bounces at databaseadvisors.com> på vegne af Susan Harkins <ssharkins at gmail.com>
Sendt: 21. december 2014 18:41
Til: dba-office at databaseadvisors.com
Emne: [Dba-office] Referencing previous sheet in Excel

Does anyone know of a formula that can reference the previous sheet,
regardless of the sheet's name? I've found several uses of Indirect(), but
they rely on the sheet names being labels somewhere else and that actually
complicates things. In this case, I have a fixed number of sheets --
January through December. It's just as easy to reference each sheet by name
as it is to create a table of names somewhere. What would be beneficial and
simpler is a single formula that can reference the same cell in the
previous sheet, regardless of the sheet it's in.

February: 'January'!B2
March: 'February'!B2
April: 'March'!B2

and so on...

If I could use the same formula in each sheet, it would be simpler.

Susan H.


More information about the Dba-office mailing list