#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Macro help

I need to create a macro so that when I select a cell and apply the macro it
will tab diliminate the contents, and arrange them in a B3, B4, B5 order as
oppose to a B3, C3, D3 order.

I can't figure out how to make it go down the column and not accross the row.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 430
Default Macro help

you could do the tab deliminate part then copy that data and 'paste
special'...'transpose'

"macro advice" wrote:

I need to create a macro so that when I select a cell and apply the macro it
will tab diliminate the contents, and arrange them in a B3, B4, B5 order as
oppose to a B3, C3, D3 order.

I can't figure out how to make it go down the column and not accross the row.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Macro help

Going across is easy, use Text to Columns. To go down use:

Sub gsnu()
Dim r As Range
For Each r In Selection
s = Split(r.Value, Chr(9))
u = UBound(s)
For i = 0 To u
r.Offset(i + 1, 0).Value = s(i)
Next
Next
End Sub

This assumes that the fields with the cell are separated by the tab character
--
Gary's Student


"macro advice" wrote:

I need to create a macro so that when I select a cell and apply the macro it
will tab diliminate the contents, and arrange them in a B3, B4, B5 order as
oppose to a B3, C3, D3 order.

I can't figure out how to make it go down the column and not accross the row.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Macro help

I just tried and that copied the cell contents into the row below it.

Here what I'm trying to do.

I'm going to have a string of charaters that looks similar to the one below:

L00262L2L00262L2L00262L2

After the 8th character, I need to populate the next cell below so it looks
like:

L00262L2
L00262L2
L00262L2

The original string will always vary in length, but will always be at least
8 characters long.

Any thoughts?

"Gary''s Student" wrote:

Going across is easy, use Text to Columns. To go down use:

Sub gsnu()
Dim r As Range
For Each r In Selection
s = Split(r.Value, Chr(9))
u = UBound(s)
For i = 0 To u
r.Offset(i + 1, 0).Value = s(i)
Next
Next
End Sub

This assumes that the fields with the cell are separated by the tab character
--
Gary's Student


"macro advice" wrote:

I need to create a macro so that when I select a cell and apply the macro it
will tab diliminate the contents, and arrange them in a B3, B4, B5 order as
oppose to a B3, C3, D3 order.

I can't figure out how to make it go down the column and not accross the row.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Macro help

O.K. then:


Sub gsnu2()
Dim r As Range, s(100) As String
Dim i As Integer, j As Integer, k As Integer
For Each r In Selection
k = 1
i = Len(r.Value) / 8
For j = 1 To i
s(j - 1) = Mid(r.Value, k, 8)
k = k + 8
Next
For i = 0 To i - 1
r.Offset(i + 1, 0).Value = s(i)
Next
Next
End Sub

will break your string into sets of 8 characters and store them in the cells
below.
--
Gary''s Student


"annap" wrote:

I just tried and that copied the cell contents into the row below it.

Here what I'm trying to do.

I'm going to have a string of charaters that looks similar to the one below:

L00262L2L00262L2L00262L2

After the 8th character, I need to populate the next cell below so it looks
like:

L00262L2
L00262L2
L00262L2

The original string will always vary in length, but will always be at least
8 characters long.

Any thoughts?

"Gary''s Student" wrote:

Going across is easy, use Text to Columns. To go down use:

Sub gsnu()
Dim r As Range
For Each r In Selection
s = Split(r.Value, Chr(9))
u = UBound(s)
For i = 0 To u
r.Offset(i + 1, 0).Value = s(i)
Next
Next
End Sub

This assumes that the fields with the cell are separated by the tab character
--
Gary's Student


"macro advice" wrote:

I need to create a macro so that when I select a cell and apply the macro it
will tab diliminate the contents, and arrange them in a B3, B4, B5 order as
oppose to a B3, C3, D3 order.

I can't figure out how to make it go down the column and not accross the row.

Reply
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
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM


All times are GMT +1. The time now is 05:39 AM.

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

About Us

"It's about Microsoft Excel"