LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default How do I do this.. Or can I?

thanks for the help and input.

I appreciate it very much.

R

"מיכאל (מיקי) אבידן" wrote:

Is it only on my computer that the "A" for RON is missing in the Macro result
table ?
Micky

"Dave Peterson" wrote:

You could use a macro.

If you want to try...

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim FirstRow As Long
Dim LastRow As Long
Dim iRow As Long
Dim TopCell As Range
Dim BotCell As Range

Set wks = Worksheets("Sheet1")

With wks
'the code adds headers!
.Range("a1").Resize(1, 4).Value _
= Array("h1", "h2", "h3", "h4")
FirstRow = 2 'avoid the header row
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

Set TopCell = Nothing 'to start process

For iRow = FirstRow To LastRow + 1 'to get last group
If .Cells(iRow, "A").Value = .Cells(iRow - 1, "A").Value _
And .Cells(iRow, "B").Value = .Cells(iRow - 1, "B").Value Then
'do nothing, still in the current group
Else
Set BotCell = .Cells(iRow - 1, "c")
If TopCell Is Nothing Then
'do nothing, first record
Else
'start of new group, so
'do copy|paste special|transpose
'of old group
.Range(TopCell, BotCell).Copy
TopCell.Offset(0, 1).PasteSpecial Transpose:=True
End If
'get ready for next time
Set TopCell = .Cells(iRow, "c")
Set BotCell = .Cells(iRow, "c")
End If
Next iRow

'uncomment these when your tests look ok.
'remove column C
.Columns(3).Delete

'get rid of the empty rows based on column C
.Columns(3).Cells.SpecialCells(xlCellTypeBlanks).E ntireRow.Delete

'get rid of the added headers
.Rows(1).Delete

End With

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Roman wrote:

I have data that looks like the example below:
fistname, last name, multiple rows, each with different data
RON SMITH A
RON SMITH B
RON SMITH C
RON SMITH D
RON SMITH H


My merge program reads data like the sample below:
First name. last name, one row, but multiple cells, each with different data.

RON SMITH A B C D H

Can someone tell me the best way to convert my existing data into the format
above?

Any help is much appreciated.

Thanks
R


--

Dave Peterson
.

 
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



All times are GMT +1. The time now is 04: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"