Paul Naylor
Board Regular
- Joined
- Sep 2, 2016
- Messages
- 99
- Office Version
- 365
- 2003 or older
- Platform
- Windows
- Mobile
- Web
Hi . I'll start by saying i'm tying to do this in excel 97 , which were still using at work
Linking to previous worksheet. I've downloaded the following VBA code so instead of having to keep changing worksheet names in formula's I can use "PrevSheet" command , which does work, but having problems combining this with Vlookup
2 sets of data :
Sheet 1 ( Yesterday's date)
Job No ( Column A)
Previous Days Actions ( Column B)
Today's Actions ( Column C)
Sheet 2 ( Today's date)
Job No ( Column A)
Previous Days Actions ( Column B)
Today's Actions ( Column C)
Requirement: in sheet 2 ( today's) want to do a vlookup on job no. on previous sheet and if "True" display the result display the contents previous days actions ( column C) in today's column D, but if previous days actions is BLANK ( column c) , display previous days actions ( column B) and if that is BLANK display a text message "No previous actions".
Hoping someone can help.........
Function PrevSheet(RCell As Range)
Dim xIndex As Long
Application.Volatile
xIndex = RCell.Worksheet.Index
If xIndex > 1 Then _
PrevSheet = Worksheets(xIndex - 1).Range(RCell.Address)
End Function
Linking to previous worksheet. I've downloaded the following VBA code so instead of having to keep changing worksheet names in formula's I can use "PrevSheet" command , which does work, but having problems combining this with Vlookup
2 sets of data :
Sheet 1 ( Yesterday's date)
Job No ( Column A)
Previous Days Actions ( Column B)
Today's Actions ( Column C)
Sheet 2 ( Today's date)
Job No ( Column A)
Previous Days Actions ( Column B)
Today's Actions ( Column C)
Requirement: in sheet 2 ( today's) want to do a vlookup on job no. on previous sheet and if "True" display the result display the contents previous days actions ( column C) in today's column D, but if previous days actions is BLANK ( column c) , display previous days actions ( column B) and if that is BLANK display a text message "No previous actions".
Hoping someone can help.........
Function PrevSheet(RCell As Range)
Dim xIndex As Long
Application.Volatile
xIndex = RCell.Worksheet.Index
If xIndex > 1 Then _
PrevSheet = Worksheets(xIndex - 1).Range(RCell.Address)
End Function