|
-
Feb 7th, 2005, 10:16 AM
#1
Thread Starter
Junior Member
Telling VBA to find a cell, row, column, range
Hello,
Main question I have is: Am I calling/referring to the rows/columns poperly... i say I'm not because no values get exported for my iDate, nor my Rev.
I have row B starting at B11:B41, those have dates i need to pull. Corresponding to those rows in column B is Columns J-V stepping 2 to pull the Rev.
Ex.
B11 = 1/1/2004 (if B11 is date then idate = B11) and
the Rev = J11, L11, N11, P11, R11, T11, V11...
I go through this all the way down to cell B41.
I just don't think I am Declaring them right i.e string, interger etc... Get Type Mismatch errors.
nor refrecing the cells in the rows properly...
Thanks,
John
1. Dim sCol As Integer
2. Set rAccts1 = oMarketSheet.Columns("B").SpecialCells(xlCellTypeConstants)
3. Set rRow = oMarketSheet.Rows.Range("B11:B41")
4. ' For Each rCell In Range(Range("B11"), Range("B11").End(xlDown)).Cells
5. For Each rRow In rAccts1
6. If IsDate(rCell.Value) Then 'Cells(11, 2)
7. For sCol = oMarketSheet.Columns("J").rRow.Value To oMarketSheet.Columns("V").rRow.Value Step 2 '
8. iDate = rAccts1.rRow.Value
9. Select Case Accnt
10. Case sCol = oMarketSheet.Columns("J").Value 'Cells(rCell, i) = j
11. Accnt = "010-41200"
12. Case sCol = oMarketSheet.Columns("L").Value 'Cells(rCell, i) = l
13. Accnt = "010-41215"
14. Case sCol = oMarketSheet.Columns("N").Value 'Cells(rCell, i) = n
15. Accnt = "010-41225"
16. Case sCol = oMarketSheet.Columns("P").Value 'Cells(rCell, i) = p
17. Accnt = "010-41340"
18. Case sCol = oMarketSheet.Columns("R").Value 'Cells(rCell, i) = r
19. Accnt = "010-41230"
20. Case sCol = oMarketSheet.Columns("T").Value 'Cells(rCell, i) = t
21. Accnt = "010-41290"
22. Case sCol = oMarketSheet.Columns("V").Value 'Cells(rCell, i) = v
23. Accnt = "010-41240"
'Case Else Accnt = "010-41320"
24. End Select
25. 'Rooms = Cells(rCell.Value, i)
26. Rev = oMarketSheet.Columns("J" + 1).rRow.Value
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|