+ Reply to Thread
Results 1 to 6 of 6

spring to the next line

  1. #1
    Registered User
    Join Date
    08-31-2015
    Location
    Switzerland
    MS-Off Ver
    13
    Posts
    3

    spring to the next line

    Hello,

    I wrote the following program to split a txt which is in the active cell. Now should the program spring from the active cell to the last cell which is not empty. How can I do this?


    PHP Code: 
    Sub Splittxt()
    Dim txt As String
    Dim i 
    As Integer
    Dim FullName 
    As Variant

    txt 
    ActiveCell.Value

    FullName 
    Split(txt"#")

    For 
    0 To UBound(FullName)

        
    Cells(11).Value FullName(i)
        
    Next i

    End Sub 
    Thanks Joseph

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: spring to the next line

    Do you mean the results to be in the last row?
    (to the last cell which is not empty)
    May be
    Please Login or Register  to view this content.
    If need to the last cell which is empty add 1 to this line
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    08-31-2015
    Location
    Switzerland
    MS-Off Ver
    13
    Posts
    3

    Re: spring to the next line

    Sorry,
    I need all result of cells whit a value until to a empty one.

    thank you so much, Josef

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: spring to the next line

    still didn't get it. can you attach your desired results?

  5. #5
    Registered User
    Join Date
    08-31-2015
    Location
    Switzerland
    MS-Off Ver
    13
    Posts
    3

    Re: spring to the next line

    Okay,

    it runs whit the following code:

    Sub splitText()
    Dim rng As Range, vntTmp As Variant

    For Each rng In Range("A1:A100")
    If InStr(1, rng.Text, "#") > 0 Then
    vntTmp = Application.Transpose(Application.Transpose(Split(rng.Text, "#")))
    rng.Offset(0, 1).Resize(1, UBound(vntTmp)) = vntTmp
    End If
    Next
    End Sub

    Thanks for your help

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: spring to the next line

    Then try this
    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)

Similar Threads

  1. Replies: 1
    Last Post: 08-21-2014, 05:42 PM
  2. Replies: 2
    Last Post: 04-01-2013, 12:49 PM
  3. Spring Forward
    By jaslake in forum The Water Cooler
    Replies: 0
    Last Post: 03-09-2013, 11:21 PM
  4. Old guy seeks ongoing spring of Excel-ent knowledge
    By Other Bruce in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 03-06-2013, 08:41 PM
  5. spring loaded columns
    By jgdal in forum Excel General
    Replies: 1
    Last Post: 02-17-2009, 08:17 PM

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