If Sheet1.Cells(row + 1, 10) = "" Then
...
ColumnCount = 65536 - Application.WorksheetFunction.CountBlank(RealizeRaw.Range(Selection, Selection)) + 5
temprows = 1
For Row = 1 To ColumnCount
If RealizeRaw.Cells(Row, 1) = "Fund:" Then
fund_id = Split(RealizeRaw.Cells(Row, "C"), "-")
End If
If IsDate(RealizeRaw.Cells(Row, 1)) Then
If RealizeRaw.Cells(Row + 1, "J") <> 0 And RealizeRaw.Cells(Row + 1, "J") <> "" And RealizeRaw.Cells(Row, "J") <> "R " Then
INR = RealizeRaw.Cells(Row + 1, "J")
USD = RealizeRaw.Cells(Row, "J")
ElseIf RealizeRaw.Cells(Row + 1, "I") <> 0 And RealizeRaw.Cells(Row + 1, "I") <> "" And RealizeRaw.Cells(Row, "J") <> "R " Then
INR = RealizeRaw.Cells(Row + 1, "I")
USD = RealizeRaw.Cells(Row, "I")
End If
RealizeSum.Cells(temprows, "A") = fund_id(0)
RealizeSum.Cells(temprows, "B") = fund_id(1)
RealizeSum.Cells(temprows, "C") = fund_id(2)
RealizeSum.Cells(temprows, "D") = INR
RealizeSum.Cells(temprows, "E") = USD
temprows = temprows + 1
End If
Next
'Sort and Seperate Fund Numbers
RealizeSum.Activate
...
temprows = 1
For Row = 1 To ColumnCount
If RealizeRaw.Cells(Row, 1) = "Fund:" Then
fund_id = Split(RealizeRaw.Cells(Row, "C"), "-")
End If
If IsDate(RealizeRaw.Cells(Row, 1)) Then
If RealizeRaw.Cells(Row + 1, "J") <> 0 And RealizeRaw.Cells(Row + 1, "J") <> "" And RealizeRaw.Cells(Row, "J") <> "R " Then
INR = RealizeRaw.Cells(Row + 1, "J")
USD = RealizeRaw.Cells(Row, "J")
ElseIf RealizeRaw.Cells(Row + 1, "I") <> 0 And RealizeRaw.Cells(Row + 1, "I") <> "" And RealizeRaw.Cells(Row, "J") <> "R " Then
INR = RealizeRaw.Cells(Row + 1, "I")
USD = RealizeRaw.Cells(Row, "I")
End If
If INR <> "" Or USD <> "" Then
RealizeSum.Cells(temprows, "A") = fund_id(0)
RealizeSum.Cells(temprows, "B") = fund_id(1)
RealizeSum.Cells(temprows, "C") = fund_id(2)
RealizeSum.Cells(temprows, "D") = INR
RealizeSum.Cells(temprows, "E") = USD
temprows = temprows + 1
End If
INR = ""
USD = ""
End If
Next
temprows = 1
For Row = 1 To ColumnCount
If RealizeRaw.Cells(Row, 1) = "Fund:" Then
fund_id = Split(RealizeRaw.Cells(Row, "C"), "-")
End If
If IsDate(RealizeRaw.Cells(Row, 1)) Then
If RealizeRaw.Cells(Row + 1, "J") <> "" And RealizeRaw.Cells(Row, "J") <> "R " Then
INR = RealizeRaw.Cells(Row + 1, "J")
USD = RealizeRaw.Cells(Row, "J")
ElseIf RealizeRaw.Cells(Row + 1, "I") <> "" And RealizeRaw.Cells(Row, "J") <> "R " Then
INR = RealizeRaw.Cells(Row + 1, "I")
USD = RealizeRaw.Cells(Row, "I")
End If
If INR <> "" Or USD <> "" Then
RealizeSum.Cells(temprows, "A") = fund_id(0)
RealizeSum.Cells(temprows, "B") = fund_id(1)
RealizeSum.Cells(temprows, "C") = fund_id(2)
RealizeSum.Cells(temprows, "D") = INR
RealizeSum.Cells(temprows, "E") = USD
temprows = temprows + 1
End If
INR = ""
USD = ""
End If
Next
temprows = 1
For Row = 1 To ColumnCount
If RealizeRaw.Cells(Row, 1) = "Fund:" Then
fund_id = Split(RealizeRaw.Cells(Row, "C"), "-")
End If
If IsDate(RealizeRaw.Cells(Row, 1)) Then
If RealizeRaw.Cells(Row + 1, "J") <> "" Then
INR = RealizeRaw.Cells(Row + 1, "J")
USD = RealizeRaw.Cells(Row, "J")
If RealizeRaw.Cells(Row, "J") = "R " Then INR = ""
ElseIf RealizeRaw.Cells(Row + 1, "I") <> "" Then
INR = RealizeRaw.Cells(Row + 1, "I")
USD = RealizeRaw.Cells(Row, "I")
If RealizeRaw.Cells(Row, "J") = "R " Then INR = ""
End If
If INR <> "" Or USD <> "" Then
RealizeSum.Cells(temprows, "A") = fund_id(0)
RealizeSum.Cells(temprows, "B") = fund_id(1)
RealizeSum.Cells(temprows, "C") = fund_id(2)
RealizeSum.Cells(temprows, "D") = INR
RealizeSum.Cells(temprows, "E") = USD
temprows = temprows + 1
End If
INR = ""
USD = ""
End If
Next
temprows = 1
For Row = 1 To ColumnCount
If RealizeRaw.Cells(Row, 1) = "Fund:" Then
fund_id = Split(RealizeRaw.Cells(Row, "C"), "-")
End If
If IsDate(RealizeRaw.Cells(Row, 1)) Then
INR = ""
USD = ""
If RealizeRaw.Cells(Row + 1, "J") <> "" Then
INR = RealizeRaw.Cells(Row + 1, "J")
USD = RealizeRaw.Cells(Row, "J")
ElseIf RealizeRaw.Cells(Row + 1, "I") <> "" Then
INR = RealizeRaw.Cells(Row + 1, "I")
USD = RealizeRaw.Cells(Row, "I")
End If
If RealizeRaw.Cells(Row, "J") = "R " Then USD = ""
If INR <> "" Or USD <> "" Then
RealizeSum.Cells(temprows, "A") = fund_id(0)
RealizeSum.Cells(temprows, "B") = fund_id(1)
RealizeSum.Cells(temprows, "C") = fund_id(2)
RealizeSum.Cells(temprows, "D") = INR
RealizeSum.Cells(temprows, "E") = USD
temprows = temprows + 1
End If
End If
Next
For Row = 1 To ColumnCount
If RealizeRaw.Cells(Row, 1) = "Fund:" Then
fund_id = Split(RealizeRaw.Cells(Row, "C"), "-")
End If
If IsDate(RealizeRaw.Cells(Row, 1)) And Cells(Row, 1) = Sheets("Date Input").Cells(3, "B") Then
INR = ""
USD = ""
If RealizeRaw.Cells(Row + 1, "J") <> "" Then
INR = RealizeRaw.Cells(Row + 1, "J")
USD = RealizeRaw.Cells(Row, "J")
ElseIf RealizeRaw.Cells(Row + 1, "I") <> "" Then
INR = RealizeRaw.Cells(Row + 1, "I")
USD = RealizeRaw.Cells(Row, "I")
End If
If RealizeRaw.Cells(Row, "J") = "R " Then USD = ""
If INR <> "" Or USD <> "" Then
RealizeSum.Cells(temprows, "A") = fund_id(0)
RealizeSum.Cells(temprows, "B") = fund_id(1)
RealizeSum.Cells(temprows, "C") = fund_id(2)
RealizeSum.Cells(temprows, "D") = INR
RealizeSum.Cells(temprows, "E") = USD
temprows = temprows + 1
End If
End If
Next
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Excel VBA - Public declaration of variables | 3 | 45 | |
Excel If Statement to return a value | 5 | 21 | |
Excel "2016 error could not load some objects becuase they are not available on this machine. | 7 | 21 | |
Problem with Excel and File Size | 7 | 16 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
21 Experts available now in Live!