+ Reply to Thread
Results 1 to 6 of 6

Find the Last Cell in a Row and Replace the value

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    Yerevan, Armenia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Find the Last Cell in a Row and Replace the value

    Hi,

    I need to be able to

    1) find the last filled cell in the row
    2) replace the value in that cell with a certain text ("YES")

    I am not sure where to start and what formula/function to apply.

    Could you please help?

    Thank you!
    A_K

  2. #2
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Find the Last Cell in a Row and Replace the value

    To find the last used cell in a range(example A1:M1)-row, you can use something like this.

    =LOOKUP(2,1/(A1:M1<>""),A1:M1)

    I don't think that you could replace the value in a cell using formulas. Maybe with VBA...
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,160

    Re: Find the Last Cell in a Row and Replace the value

    1) find the last filled cell in the row
    Is this one row or multiple rows in the file?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    01-11-2013
    Location
    Yerevan, Armenia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Find the Last Cell in a Row and Replace the value

    Hi,

    There are multiple (2000) rows in a file. And the last cell is different for each column.

  5. #5
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,160

    Re: Find the Last Cell in a Row and Replace the value

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  6. #6
    Registered User
    Join Date
    01-11-2013
    Location
    Yerevan, Armenia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Find the Last Cell in a Row and Replace the value

    Thank you so much, Arlu!

    This worked!~

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1