HI
I am trying to put a code to open a file in another location find specific values (string) in a column count the numbers and return which values are missing from the column. I am stuck here
Private Sub CommandButton4_Click()
'Analyse FI Data
Dim mypath As String
Dim folderpath As String
Dim filename As String
Dim MyBook As Workbook, newbook As Workbook
Set MyBook = ThisWorkbook
Dim file As String, sheetdata As String
Dim ws As Worksheet
Dim x As Workbook
Dim y As Workbook
Dim FindString As String
Dim Rng As Range
Dim findrow As Integer
Dim finalrow As Integer
Dim bottomA As Integer
Dim c As Range
Dim TESTMarkitFI2015submitted As Worksheet
Dim FIANALYSIS As Worksheet
Dim a As Range
Dim col As Integer
Dim row As Integer
Dim cell As Integer
Dim inputbox As Variant
Dim application As String
Dim value As String
Dim iVal As Integer
Dim lastrow As Long
Dim i As Integer, icount As Integer
Dim rgFound As Range
Dim arr() As Variant
Dim rownumber As Integer
Dim countifstring As Integer
Dim Workbook As Workbook
Dim searchstring As Range
Dim name As Variant, cnt As Long
Dim MyObject As Object
Dim iteminreview As Workbook
Dim myarray As Integer
Dim bond As String
Dim promissoryNote As String
Dim loan As String
Dim certificatesOfDeposit As String
Dim embededOptionBond As String
Dim repo As String
Dim bondOption As String
Dim bondForward As String
Dim securedBond As String
Dim inflationLinkedBond As String
Set x = Workbooks.Open(filename:="Z:\Profiles\My Documents\MAPPING\TEST MAPPING TABLES\TEST_Markit_FI_2015 - submitted.csv")
worksheets("TEST_Markit_FI_2015 - submitted").Range("A:A").Select
rownumber = 0
countifstring = 0
'searchstring = Sheets("TEST_Markit_FI_2015 - submitted").Range("A:A")
Do
DoEvents
rownumber = rownumber + 1
'
'worksheets("TEST_Markit_FI_2015 - submitted").Range ("A:A" & "rownumber")
'
'iteminreview = Workbook("TEST MAPPING TABLES")
If Range("A:A", "bond", "promissorynote", "loan", "certificate of deposit", "embededOptionBond", "repo", "bondOption", "bondForward", "securedBond", "inflationLinkedBond") Then
countifstring = countifstring + 1
End If
Loop Until iteminreview = ""
MsgBox "the string occured:" & countifstring & "times"
For i = 2 To lastrow
lastrow = Cells(Rows.Count, 1).End(xlUp).row
Set rgFound = Range("A:A").Find("bond, promissorynote, loan, certificate of deposit, embededOptionBond, repo, bondOption, bondForward, securedBond, inflationLinkedBond") LookIn:=xlComments)
If Cells(i, 1).value = ("bond"), ("promissorynote"), ("loan"), ("certificate of deposit"), ("embededOptionBond"), ("repo"), ("bondOption"), ("bondForward"), ("securedBond"), ("inflationLinkedBond") Then
Debug.Print "Total number of bonds is:";
Workbooks("TEST_Markit_FI_2015 - submitted.csv").Close savechanges:=False
End If
Next
End Sub
I am trying to put a code to open a file in another location find specific values (string) in a column count the numbers and return which values are missing from the column. I am stuck here
Private Sub CommandButton4_Click()
'Analyse FI Data
Dim mypath As String
Dim folderpath As String
Dim filename As String
Dim MyBook As Workbook, newbook As Workbook
Set MyBook = ThisWorkbook
Dim file As String, sheetdata As String
Dim ws As Worksheet
Dim x As Workbook
Dim y As Workbook
Dim FindString As String
Dim Rng As Range
Dim findrow As Integer
Dim finalrow As Integer
Dim bottomA As Integer
Dim c As Range
Dim TESTMarkitFI2015submitted As Worksheet
Dim FIANALYSIS As Worksheet
Dim a As Range
Dim col As Integer
Dim row As Integer
Dim cell As Integer
Dim inputbox As Variant
Dim application As String
Dim value As String
Dim iVal As Integer
Dim lastrow As Long
Dim i As Integer, icount As Integer
Dim rgFound As Range
Dim arr() As Variant
Dim rownumber As Integer
Dim countifstring As Integer
Dim Workbook As Workbook
Dim searchstring As Range
Dim name As Variant, cnt As Long
Dim MyObject As Object
Dim iteminreview As Workbook
Dim myarray As Integer
Dim bond As String
Dim promissoryNote As String
Dim loan As String
Dim certificatesOfDeposit As String
Dim embededOptionBond As String
Dim repo As String
Dim bondOption As String
Dim bondForward As String
Dim securedBond As String
Dim inflationLinkedBond As String
Set x = Workbooks.Open(filename:="Z:\Profiles\My Documents\MAPPING\TEST MAPPING TABLES\TEST_Markit_FI_2015 - submitted.csv")
worksheets("TEST_Markit_FI_2015 - submitted").Range("A:A").Select
rownumber = 0
countifstring = 0
'searchstring = Sheets("TEST_Markit_FI_2015 - submitted").Range("A:A")
Do
DoEvents
rownumber = rownumber + 1
'
'worksheets("TEST_Markit_FI_2015 - submitted").Range ("A:A" & "rownumber")
'
'iteminreview = Workbook("TEST MAPPING TABLES")
If Range("A:A", "bond", "promissorynote", "loan", "certificate of deposit", "embededOptionBond", "repo", "bondOption", "bondForward", "securedBond", "inflationLinkedBond") Then
countifstring = countifstring + 1
End If
Loop Until iteminreview = ""
MsgBox "the string occured:" & countifstring & "times"
For i = 2 To lastrow
lastrow = Cells(Rows.Count, 1).End(xlUp).row
Set rgFound = Range("A:A").Find("bond, promissorynote, loan, certificate of deposit, embededOptionBond, repo, bondOption, bondForward, securedBond, inflationLinkedBond") LookIn:=xlComments)
If Cells(i, 1).value = ("bond"), ("promissorynote"), ("loan"), ("certificate of deposit"), ("embededOptionBond"), ("repo"), ("bondOption"), ("bondForward"), ("securedBond"), ("inflationLinkedBond") Then
Debug.Print "Total number of bonds is:";
Workbooks("TEST_Markit_FI_2015 - submitted.csv").Close savechanges:=False
End If
Next
End Sub