LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Split and transpose cell value

On Wednesday, November 1, 2017 at 5:11:20 AM UTC-7, Claus Busch wrote:
Hi Howard,

Am Tue, 31 Oct 2017 21:19:10 -0700 (PDT) schrieb L. Howard:

Sub Split_Transpose()
Dim oneRng As Range, ddFound As Range
Dim dDwn As String
Dim X As Variant



dDwn = Sheets("Sheet4").Range("J8")
Set oneRng = Sheets("Sheet5").Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)


With Sheets("Sheet5")
Set ddFound = Sheets("Sheet5").UsedRange.Find(What:=dDwn, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not ddFound Is Nothing Then

X = Split(ddFound.Offset(, 1).Value, ",")
Sheets("Sheet5").Range("C2").Resize(UBound(X) - LBound(X) + 1).Value = Application.Transpose(X)

Else
MsgBox "No match found."
End If

End With


End Sub


there are some superfluous lines in your code.

Try:

Sub Split_Transpose()
Dim oneRng As Range, ddFound As Range
Dim dDwn As String
Dim X As Variant

dDwn = Sheets("Sheet4").Range("J8")

With Sheets("Sheet5")
Set ddFound = .Range("A:A").Find(What:=dDwn, _
LookIn:=xlValues, _
LookAt:=xlWhole)
If Not ddFound Is Nothing Then
X = Split(ddFound.Offset(, 1).Value, ",")
.Range("C2").Resize(UBound(X) + 1).Value = Application.Transpose(X)
Else
MsgBox "No match found."
End If

End With
End Sub


Regards
Claus B.


Hi Claus,

Yes, some lines not needed that I had not cleaned up.

Yours is, of course, quite tidy.

Thanks much.

Howard
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transpose Cell Contents RB[_2_] Excel Worksheet Functions 1 April 12th 14 07:34 PM
Transpose cell references RSunday Excel Discussion (Misc queries) 1 February 15th 08 01:39 PM
find first empty cell in column and start transpose next row in that cell ali Excel Discussion (Misc queries) 6 July 21st 07 11:55 PM
find first empty cell in column and start transpose next row in that cell ali Excel Programming 3 July 21st 07 03:12 PM
copy, split and transpose a range of values Lucas Budlong Excel Programming 0 April 5th 06 11:36 AM


All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"