Use a variable to define the row number in a Range ("???").select

Dim r as integer
r=5
Range("G r").select
This stalls with 'Range' _Global fail
I want to manipulate r (the row that logic produces) and use to select a cell
Help...fix

Re:  specify a range
Dim r As Long
r = 5
Cells(r, "G").Select
-or-
Range("G" & r).Select
Jim Cone
Portland, Oregon USA
free & commercial excel programs (n/a xl2013)
https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

Similar Messages

  • Calculating the row number with DAX

    Hello,
    Can somebody help me to obtain the row number in a calculated column using DAX (PowerPivot 2013) ?
    I do not have any column that would contain unique values (would be easy in that case !). I just want to obtain a different value in each row.
    Thank you.

    Hi DP17000,
    According to your description, you need to add a column with the RowNumber to your Pivot table by using DAX, right?
    Based on my tested, we can use a ranks function to achieve your requirement.
    =RANKX(case0305,[amount],[amount],0,dense)
    Reference
    https://msdn.microsoft.com/en-us/library/gg492185.aspx?f=255&MSPPError=-2147217396
    http://ayadshammout.com/2013/02/19/dax-rankx-function-scenarios/
    Regards,
    Charlie Liao
    TechNet Community Support

  • Retrieving the row number where a certain value exists

    Hi,
    I wanted to find out if there is a way to retrieve the row number of a row where a certain value exists. For example, if I had a query
    Create or replace Procedure p1
    IS
    v_Stmt varchar2(100);
    BEGIN
    v_Stmt := 'Select * from emp where lname = 'Davis'';
    Execute Immediate v_Stmt;
    END;
    SQL> exec p1;
    Then, I would like to find out that this name is on row 3.
    Can anyone tell me how this can be done?
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    theres is no rownum related to a particular row. A rownum is a pseudocolumn which value may be different for the same row depending on the query you do. What you can use is the rowid which is the row's address.
    HTH
    Maurice

  • I can't get the row number of the current selection

    Hi all,
    How can I get the row number of a selection if I don't know the range selected? I need it to store in variable.
    I've tried in many ways, but unsuccesfully.
    Thank's in advance.

    If you already know the document's name, the sheet's name and the table's name, the easy way is :
    --Here you may replace the three values by the current ones
    set dName to 1
    set sName to 1
    set tName to 1
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
    tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
    end tell
    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21

  • Retrieving the row number of a specific record from the results of a MySQL query

    I want to create a MySQL query that will return a list of
    records, and then retrieve the row number of a record with a
    specific ID. How can I do this?
    *server-side script: PHP

    <?php
    $i = 0;
    do {
    $i++;
    } while (mysql_fetch_assoc($rsWhatever) &&
    $row_rsWhatever['ID'] !=57);
    echo "TADA -" . $i;
    ?>
    (assuming that ID is numeric, and that the test value
    actually exists in the
    database)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "AngryCloud" <[email protected]> wrote in
    message
    news:g4e6ck$hrb$[email protected]..
    >I will use this scenario for an example:
    >
    > I want to know how far down the list I will find the ID,
    '57'.
    >
    > So I manually look at the list of results and see it is
    the 25th record
    > down
    > on the list.
    >
    > How do I get my PHP script to get this number (25)
    automatically?
    >

  • How can i know the row number of my table is being modified?

    HI all,
    I have a table in my web dynpro and several columns as checkbox... I put an event OnToggle in these columns.
    Do you know any way to get the row or the row number?
    If i use the method get_static_attributes return to me the selected row not the modified.
    Thanks in advance !

    EDIT: thanks ! is solved, i need to pass CONTEXT_ELEMENT' in the  <ELEMNT_NAME>
    This is my code:
    DATA table_element TYPE REF TO if_wd_context_element.
      DATA row_index TYPE i.
      table_element = wdevent->get_context_element('CONTEXT_ELEMENT').
      IF NOT table_element IS INITIAL.
        row_index = table_element->get_index( ).
      ENDIF.
    Edited by: Husalban RM on Sep 15, 2010 4:53 PM

  • How to display the rows number of times by giving the column values?

    Hi All,
    I want to display the rows number of times as the value exists in num column in the below query
    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         SELECT 'krishna' NAME,     'hyd' LOC, 1 NUM FROM DUAL )
      SELECT T.* FROM T
      CONNECT BY ROWNUM <= NUM
    Expected output:
             venkatesh            hyd      2
             venkatesh            hyd        2
             prasad                 hyd        3
             prasad                   hyd      3
             prasad                   hyd      3
             krishna           hyd       1Edited by: Nag Aswadhati on Nov 1, 2012 12:34 AM

    Nag Aswadhati wrote:
    Hi All,
    I want to display the rows number of times as the value exists in num column in the below query
    Expected output:
    venkatesh            hyd      2
    venkatesh            hyd        2
    prasad                 hyd        3
    prasad                   hyd      3
    prasad                   hyd      3
    krishna           hyd       1Using Connect By:-
    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         select 'krishna' name,     'hyd' loc, 1 num from dual )
      select t.name, t.loc
      from t
      connect by level <= num
             and name = prior name
             and (prior sys_guid() is not null);
    NAME      LOC
    krishna   hyd
    prasad    hyd
    prasad    hyd
    prasad    hyd
    venkatesh hyd
    venkatesh hyd
    6 rows selected

  • How can I get the row number of display automatically on a table?

    I have a table of measurements, and I would like the row number to be displayed on each row. The challenge is that each time I run the program, the total number of rows will be different, so I would like the numbers to update every time I run the program based on the current number of rows.
    I have attached a picture to illustrate what I am trying to do.
    Solved!
    Go to Solution.
    Attachments:
    picture of table.JPG ‏70 KB

    Find the attached example (saved in version 2009), and you can extract what you need for your code...!!
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    Example (Enter Row Header).vi ‏12 KB

  • How to get the row number

    Hi list,
    does any one know how I can get the row number the same as what I have in column rowno?
    thanks
    Arvin
    REATE   TABLE dbo.temptable
    ( y int  NOT NULL,
      e int not null,
      c int not null,
      rowno int not null)
    /* insert values  */
    INSERT INTO dbo.temptable(y,e,c,rowno ) VALUES
    (1,1,1,1),
    (1,1,2,1),
    (1,1,3,1),
    (1,20,1,2),
    (1,20,2,2),
    (1,20,3,2),
    (1,3,1,3),
    (1,3,1,3),
    (2,1,1,1),
    (2,1,1,1),
    (2,2,1,2),
    (2,2,1,2);

    You may update your rownumber column with Column "e".
    But why do you duplicate your data? May be there is no particular reason, you may be wasting space for it
    Try the below:
    CREATE TABLE dbo.temptable
    ( y int NOT NULL,
    e int not null,
    c int not null,
    ronum int null)
    INSERT INTO dbo.temptable(y,e,c ) VALUES
    (1,1,1),
    (1,1,2),
    (1,1,3),
    (1,20,1),
    (1,20,2)
    select * from temptable
    update dbo.temptable Set ronum=e
    Select * From dbo.temptable
    DRop table dbo.temptable

  • I want to use variation funtion without define the characteristic...

    Dear.
    I want to use variation funtion without define the characteristic into general data selection in making report painter.
    Finally hopeful thing is, The extract data which contain that characteristic group should be used in the whole sub-hierarchy
    automatically such as I did that in general data selection.
    For example, supposing the profit center group A is composed like below,
       A
      └─ B
    └─ C
    .....└─ D
    When I make report painter, if the profit center positioned in lead column not general data,
    I can't use variation funtion in profit center. So, I must save extract data each profit center group manually. (A,B,C,D..)
    It is so uncomfortalble.(Guess the profit center group composed over hundreds.)
    You know, the profit center located in general data, I just need to extract data only once in A. Then B,C,D also saved automatically.
    Why can't do this in former case ? If possible, please let me know.

    Replace af with h.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <f:view>
    <h:messages id="m1"/>
    <h:form id="f1">
    <h:outputText value="#{inputValue}" id="ot1"/>
    </h:form>
    </f:view>

  • TableView -- get the row number of the top most current visible row

    Is there any way to get the row number of the top most visible row, and or bottom most visible row in TableView?

    If you already know the document's name, the sheet's name and the table's name, the easy way is :
    --Here you may replace the three values by the current ones
    set dName to 1
    set sName to 1
    set tName to 1
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
    tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
    end tell
    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21

  • About the row number of the datagrid[Flex 2.0 beta3]

    I want to add a column to the datagrid,which will indicates
    the row number.Who can tell me how to do it?
    And how to keep the number's sequence unchanged when the
    header of one of other columns is cliked to sort the
    data?

    If I understand this correctly. Then would it not make more
    sense to say in
    the LiveDocs --
    makeObjectsBindable - After the remote call (RPC, HTTP, SOAP,
    etc) returns
    its value. Flex tries to automatically convert the result
    into an
    ArrayCollection (if it looks like an array, even if it was
    XML) [Or
    others???] format. This automatic conversion controlled by
    the
    makeObjectBindable property. If false, Flex does not attempt
    the conversion
    and the result will be in (xml?) format.
    "peterent" <[email protected]> wrote in
    message
    news:eali1i$1q9$[email protected]..
    > Results that come back which look like Arrays will be
    turned into
    > ArrayCollections automatically. Since most people
    immediate turn an Array
    > into
    > an ArrayCollection, we went ahead and did it for you.
    Try getting rid of
    > your
    > new ArrayCollection in the result handler.
    >

  • CS5: Why do I need 2 places to define the Chapter Number style?

    Hello,
    I was wondering, when I use Chapter Number via the text Variables, I can define the nubers style over there, but I can also define it via Numbering and Sections options.
    Why do I need 2 places to define that?
    thanks,
    shlomit

    Hello,
    I was wondering, when I use Chapter Number via the text Variables, I can define the nubers style over there, but I can also define it via Numbering and Sections options.
    Why do I need 2 places to define that?
    thanks,
    shlomit

  • Using a variable to vary the WHERE clause in a statement

    I have an int column that has values >= 0.
    Depending on a variable I want to select all the rows of the table or only the rows where the int column is 0.
    How do I do this?
    Your help would be much appreciated.
    Thanking you in anticipation.
    Roger
    rogerwithnell

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Why do you think "a variable" and "the integer column" are precise clear specs? I hate to tell you but zero is a integer. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • PHP Code: Using a variable to name the file in an Include

    I have a series of case statements assigning a value to the
    variable $theme
    based on the current month. Then I have a set of files
    (january.txt,
    february.txt, etc.). The variable values are those file
    names:
    // get current month as a number
    $month = date('n');
    // select theme for the month
    switch($month) {
    case 3:
    $theme = 'march.txt';
    break;
    case 4:
    $theme = 'april.txt';
    break;
    [etc.]
    What is the correct syntax for a PHP Include that will use
    the current value
    of $themes for the filename?
    Thanks
    Walt

    <?php include('_inc/'.$theme); ?>
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Walt F. Schaefer" <[email protected]> wrote in
    message
    news:gqutqv$qbf$[email protected]..
    >I have a series of case statements assigning a value to
    the variable $theme
    >based on the current month. Then I have a set of files
    (january.txt,
    >february.txt, etc.). The variable values are those file
    names:
    > // get current month as a number
    > $month = date('n');
    > // select theme for the month
    > switch($month) {
    > case 3:
    > $theme = 'march.txt';
    > break;
    > case 4:
    > $theme = 'april.txt';
    > break;
    > [etc.]
    > What is the correct syntax for a PHP Include that will
    use the current
    > value of $themes for the filename?
    >
    > Thanks
    >
    > --
    >
    > Walt
    >
    >
    >

Maybe you are looking for

  • What I see on my screen is enlarged by about 300%. How can I get it back to normal?

    My screen display has been enlarged somehow (Maybe 300% larger than normal). Now, when I turn it on, I see the enlarged screen and only a fourth or less of what I should see on the screen, is visible. I can get it to go back to normal. I have already

  • Skype blue screen of death when launching (7.3)

    Hi, I get blue screen of death on booting up of skype since last week, and have no idea why. Version 7.3. I have installed older versions and it still blue screens, in addition to updating video drivers which doesn't work either . Here is DirectX dia

  • Asian-English Charactors problem with iTunes

    I have two computers. Both of them are PCs with Windows XP Pro OS. However, one of them has Asian Language package installed. First, I transfered Asian songs through the Asian Language PC. The Asian language ID3 tags displayed correctly in the iTunes

  • Mail body as attachment in email

    Hi, whenever we are sending mails through the FM SO_DOCUMENT_SEND_API1 the text in the body is going as text attachment in the mail. This problem is occuring when the mail is viewed in outlook , in the business workplace the mail is looking good (bod

  • Linked Server SQL 2008 64 bit Windows Server 2008 64 bit

    Hello there, I'm trying to access my customers Oracle database with a SQL Linked Server. The error I get is: Cannot create an instance of OLE DB provider "OraOLEDB.Oracle" for linked server... I did the following steps: 1. Installed Oracle client 10g