C
cowannbell
Goodmorning!
I don't know much about VB, but I have an excel workbook that has VB.
I have updated it in the past to read current info, but have now run
out of space on the first worksheet and will need to start adding info
to a second worksheet. I need to know how to get excel to read the
second worksheet, when a particular Schedule is seleted. All of the
info it currently reads is on a sheet called, "PPO". I am now going to
have a second sheet and need it to read from there when it gets to say,
Sch #704
I'm attaching part of the VB code.
Any help would be greatly appreciated.
Thanks,
Dim Schedule_No As String
Dim ADA_No As String
Sub calculate()
Let Schedule_No = Sheets("PPO").[B5]
Let ADA_No = Sheets("PPO").[B8]
Range("A1").Select
ActiveCell.Offset(0, 10).Activate
Call calculate_ADA(ADA_No)
Sheets("PPO").[F2].Value = ActiveCell.Value
Call calculate_Schedule(Schedule_No)
Sheets("PPO").[F1].Value = ActiveCell.Value
SendKeys "{Tab}"
Range("A5").Select
End Sub
Sub calculate_ADA(ADA_No)
Select Case ADA_No
Case "D0120", "d0120"
ActiveCell.Offset(1, 0).Activate
Case "D0140", "d0140"
ActiveCell.Offset(2, 0).Activate
Case "D0150", "d0150"
ActiveCell.Offset(3, 0).Activate
Case "D0160", "d0160"
ActiveCell.Offset(4, 0).Activate
Case Else
Range("B8").Activate
End Select
End Sub
Sub calculate_Schedule(Schedule_No)
Select Case Schedule_No
Case 700
ActiveCell.Offset(0, 1).Activate
Case 701
ActiveCell.Offset(0, 2).Activate
Case 702
ActiveCell.Offset(0, 3).Activate
Case 703
ActiveCell.Offset(0, 4).Activate
Case Else
Range("B5").Activate
End Select
End Sub
I don't know much about VB, but I have an excel workbook that has VB.
I have updated it in the past to read current info, but have now run
out of space on the first worksheet and will need to start adding info
to a second worksheet. I need to know how to get excel to read the
second worksheet, when a particular Schedule is seleted. All of the
info it currently reads is on a sheet called, "PPO". I am now going to
have a second sheet and need it to read from there when it gets to say,
Sch #704
I'm attaching part of the VB code.
Any help would be greatly appreciated.
Thanks,
Dim Schedule_No As String
Dim ADA_No As String
Sub calculate()
Let Schedule_No = Sheets("PPO").[B5]
Let ADA_No = Sheets("PPO").[B8]
Range("A1").Select
ActiveCell.Offset(0, 10).Activate
Call calculate_ADA(ADA_No)
Sheets("PPO").[F2].Value = ActiveCell.Value
Call calculate_Schedule(Schedule_No)
Sheets("PPO").[F1].Value = ActiveCell.Value
SendKeys "{Tab}"
Range("A5").Select
End Sub
Sub calculate_ADA(ADA_No)
Select Case ADA_No
Case "D0120", "d0120"
ActiveCell.Offset(1, 0).Activate
Case "D0140", "d0140"
ActiveCell.Offset(2, 0).Activate
Case "D0150", "d0150"
ActiveCell.Offset(3, 0).Activate
Case "D0160", "d0160"
ActiveCell.Offset(4, 0).Activate
Case Else
Range("B8").Activate
End Select
End Sub
Sub calculate_Schedule(Schedule_No)
Select Case Schedule_No
Case 700
ActiveCell.Offset(0, 1).Activate
Case 701
ActiveCell.Offset(0, 2).Activate
Case 702
ActiveCell.Offset(0, 3).Activate
Case 703
ActiveCell.Offset(0, 4).Activate
Case Else
Range("B5").Activate
End Select
End Sub