Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default vba newbie - explanation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default vba newbie - explanation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default vba newbie - explanation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default vba newbie - explanation

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
explanation ssrvant Excel Programming 3 October 31st 07 05:10 PM
Explanation please Mekinnik Excel Programming 2 October 31st 07 03:10 PM
Need an explanation JLGWhiz Excel Programming 2 June 15th 07 08:13 PM
Explanation of when & how to use ( ) { } : ; , ! etc? Paul (Sydney Australia) New Users to Excel 4 May 2nd 07 01:54 AM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"