Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Main()
Dim rng as Range set rng = range("A1:A2") Range("A1").Value = 5 Range("A2").Value = 4 myPrint rng End Sub function myPrint(userrange as Range) dim cell as Range for each cell in userrange debug.print cell.Address(0,0) & " = " & cell.Value next end function -- Regards, Tom Ogilvy "jimx " wrote in message ... Can you please tell me how to get the row and col of the cell that the 'for each cell in userrange' command in vba in excel is Processing. ex: a1=5 a2=4 function print("a1:a2") for each cell in userrange debug.print cell.Value ' I hope to be able to print a1 = 5 and a2=4 next end function will print 5 4 But how can I tell that it is processing a1 or a2 and put THAT value in a variable? What IS cell.Value? is cell a class? and does this class have cell.ref or cell.row or ANYthing? thank you --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! | Excel Discussion (Misc queries) | |||
convert "15000" to "Fifteen thousand" in excel cell? | Excel Worksheet Functions | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) | |||
how can I make an excel cell "mark" or "unmark" when clicked on? | Excel Discussion (Misc queries) |