Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am just starting to use vba w/ excel. Could someone perhaps please explain
the following code: sFilename = Right(Me.Cells(i, "A").Value, Len(Me.Cells(i, "A").Value) - InStrRev(Me.Cells(i, "A").Value, "_")) i know that the functions "Right", "Len", "In Str Rev" will become the sFilename which is called elsewhere; i am befuddled by the (Me.Cells(i, "A").Value). thanks for helping me get jumpstarted. patti |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Me refers to the containing object, which is undoubtedly the sheet in this
case. So this code is within a sheet class module. Cells(i,"A") is just picking up the cell in column A, row i. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "patti" wrote in message ... I am just starting to use vba w/ excel. Could someone perhaps please explain the following code: sFilename = Right(Me.Cells(i, "A").Value, Len(Me.Cells(i, "A").Value) - InStrRev(Me.Cells(i, "A").Value, "_")) i know that the functions "Right", "Len", "In Str Rev" will become the sFilename which is called elsewhere; i am befuddled by the (Me.Cells(i, "A").Value). thanks for helping me get jumpstarted. patti |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Me is the thing that holds the code.
In your case, I bet that this code is behind a worksheet. So me.cells(i,"A").value is the value in the cell in column A, Row i Me can be used in the ThisWorkbook module, too. In that case, it refers to the workbook that owns the code. Equivalent to ThisWorkbook. Me can be used behind a userform, too. Me.combobox1.listindex = -1 would clear combobox1 on the userform that owns the code. patti wrote: I am just starting to use vba w/ excel. Could someone perhaps please explain the following code: sFilename = Right(Me.Cells(i, "A").Value, Len(Me.Cells(i, "A").Value) - InStrRev(Me.Cells(i, "A").Value, "_")) i know that the functions "Right", "Len", "In Str Rev" will become the sFilename which is called elsewhere; i am befuddled by the (Me.Cells(i, "A").Value). thanks for helping me get jumpstarted. patti -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob & Dave for getting me started off on the right foot!
"patti" wrote: I am just starting to use vba w/ excel. Could someone perhaps please explain the following code: sFilename = Right(Me.Cells(i, "A").Value, Len(Me.Cells(i, "A").Value) - InStrRev(Me.Cells(i, "A").Value, "_")) i know that the functions "Right", "Len", "In Str Rev" will become the sFilename which is called elsewhere; i am befuddled by the (Me.Cells(i, "A").Value). thanks for helping me get jumpstarted. patti |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
explanation | Excel Programming | |||
Explanation please | Excel Programming | |||
Need an explanation | Excel Programming | |||
Explanation of when & how to use ( ) { } : ; , ! etc? | New Users to Excel | |||
Real Newbie newbie question | New Users to Excel |