sharon9999
New Member
- Joined
- Mar 21, 2017
- Messages
- 20
Hi
VBA code is only taking the data from the 1st tab and importing.
How do I ask it to import the data from the 2nd tab. The aim is to have 2 tabs with different data. Here is the first part of the code for the 1st tab:
Public Sub ImportPayment_Details()
Const ACCOUNT_NAME = "ACCOUNT_NAME"
Const PAYMENT_DATE = "PAYMENT_DATE"
Const PAYMENT_TYPE = "PAYMENT_TYPE"
Const AMOUNT = "AMOUNT"
Const NODE_NAME = "NODE_NAME"
Dim colACCOUNT_NAME As Integer
Dim colPAYMENT_DATE As Integer
Dim colPAYMENT_TYPE As Integer
Dim colAMOUNT As Integer
Dim colNODE_NAME As Integer
Dim foundCell As Range
Dim newWS As Worksheet
Dim wbData As Workbook
Dim filename = "BILL_CYCLE"As String
filename = (Filename)
Set wbData = Workbooks.Open(filename)
So the first tab is Payment Details and the 2nd Order details with the data selected in the code.
TIA
SC
VBA code is only taking the data from the 1st tab and importing.
How do I ask it to import the data from the 2nd tab. The aim is to have 2 tabs with different data. Here is the first part of the code for the 1st tab:
Public Sub ImportPayment_Details()
Const ACCOUNT_NAME = "ACCOUNT_NAME"
Const PAYMENT_DATE = "PAYMENT_DATE"
Const PAYMENT_TYPE = "PAYMENT_TYPE"
Const AMOUNT = "AMOUNT"
Const NODE_NAME = "NODE_NAME"
Dim colACCOUNT_NAME As Integer
Dim colPAYMENT_DATE As Integer
Dim colPAYMENT_TYPE As Integer
Dim colAMOUNT As Integer
Dim colNODE_NAME As Integer
Dim foundCell As Range
Dim newWS As Worksheet
Dim wbData As Workbook
Dim filename = "BILL_CYCLE"As String
filename = (Filename)
Set wbData = Workbooks.Open(filename)
So the first tab is Payment Details and the 2nd Order details with the data selected in the code.
TIA
SC