Results 1 to 7 of 7

Simple Looping Help

Threaded View

  1. #1
    Registered User
    Join Date
    01-28-2013
    Location
    Belfast
    MS-Off Ver
    Excel 2010
    Posts
    39

    Simple Looping Help

    Hi,

    I have data in Range A3:A33 in an activesheet. I have the following piece of code that edits the data in range A3 and pastes a new value into C3. Could someone help me write a loop that cycles through each cell in the range of data and performs the editing task?

    Sub length()
    
    Dim PlayerName As String
    Dim PlayerName2 As String
    
    PlayerName = Range("A3")
    'PlayerName2 = Left(PlayerName, InStr(PlayerName, " "))
    PlayerName2 = Left(PlayerName, InStr(InStr(1, (PlayerName), " ") + 1, (PlayerName), " "))
    Range("C3") = PlayerName2
    
    End Sub
    Many thanks
    Last edited by Leith Ross; 07-10-2013 at 02:40 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

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