Senin, 15 Oktober 2012

[ExcelVBA] Re: Abbreviations to Words

 

Michael,
In programming, it is common to create variables with
names that help to identify the type of value that
they are expected to contain.

"nRow" doesn't stand for "number-Row",
it means that this is a variable for the row,
being stored in a "Numeric" data type (usually, integer)

In this case, the nFullNameColumn variable is a numeric
variable for the column containing the full name.
In the case of column "E", it would have a value if 5.

the Cells() object requires numeric parameters (row,column)
You can use variables for either parameter,
or even
Cells(nRow,"E") would work.

Yes, it is somewhat odd that "cells" is plural,
yet Cells(r,c) represents a single cell.

A range of cells can be expressed as:
Range(Cells(nRow,nCol),Cells(nRow+10,nCol))
But that's not what you were looking for.

Hope this helps explain your issue.

Paul

--- In ExcelVBA@yahoogroups.com, Michael Trombetta <mickey11030@...> wrote:
>
> David,
>
> I'm not trying to work on multiple cells; I thought Cells(4, E2:E7) was a way to select E4, but I see that does not work. 
>
> Early in this thread, Derek posted the following 
>
> Cells(nRow, nFullNameColumn).Value = clxFruit.Item("key" & nAbbreviatedNameColumn)
>
> nRow is an index in a For loop, and I assumed nFullNameColumn was a variable associated with a named range on the sheet. How does nFullNameColumn have to be defined and assigned a value to make this statement work?
>
> At the end of my last post I asked this question: With Fruit a defined name on a sheet, and nF defined by Dim nF as Range, what value does the statement Set nF = Range("Fruit") assign to nF?  does anyone know the answer to that question?
>
> Thanks for all the help,
> Michael Trombetta
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (19)
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar