+ Reply to Thread
Results 1 to 4 of 4

How can you check if the cell next to you is occupied?

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    28

    How can you check if the cell next to you is occupied?

    Hi there,

    Im really having problems with my project

    Im trying to use VBA to check if te cell next to active cell is filled with letters/numbers etc. and after this to copy a certain part of it.

    :
    Check for letters
    Copy
    Loop

    end if cell left to active cell is empty


    Sub Removeedit()

    '
    ' removeedit Macro
    '

    '

    Dim r As Integer
    r = 5 'starting row?

    Do


    If Cells(r, 1) = "" Then
    Exit Do
    End If

    If Len(Cells(r, 1)) > 4 Then

    ActiveCell.FormulaR1C1 = _
    "=IF(ISBLANK(RC[-1]),0,IFERROR(LEFT(RC[-1],SEARCH(""."",RC[-1])-1),RC[-1]))"

    End If
    r = r + 1
    Loop


    End Sub


    could anyone please help me?

    Thank you!

  2. #2
    Registered User
    Join Date
    04-19-2010
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: How can you check if the cell next to you is occupied?

    What kind of error are you getting, or what is not happening/not happening that should/shouldn't be?

    Please Login or Register  to view this content.
    Should give you a true or false if the cell is blank
    Excel\Access, VBA, C#, C++, SQL, Java

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: How can you check if the cell next to you is occupied?

    Hi!

    well it i press "run" it only works on te cell selected and doesn't continue to the next row.

    thanks

  4. #4
    Registered User
    Join Date
    04-19-2010
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: How can you check if the cell next to you is occupied?

    You would have to structure your loop accordingly.

    Please Login or Register  to view this content.

+ 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