Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default reformatting data

I have an excel spreadsheet that has contact data in one
colume as follows:

name1
company1
street1
town, st zip 1
blank line
name2
company2
street2
town, st zip 2
blank line

each line is in a different row. I would like to import it
into an access table but the data is difficult to
manipulate now without manually copying and pasting cells.
Any ideas as to how I can manipulate this data into a more
user friendly format such as:

name1 company1 street1 town1 st1 zip1
name2 company2 street2 town2 st2 zip2

thanks much
Jeff G

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default reformatting data

Jeff,

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Option Explicit
Sub TEST()

Dim R As Long
Dim F As String

Range("B:E").Clear

R = Cells(Rows.Count, 1).End(xlUp).Row
F = "=OFFSET(Sheet1!$A$1,ROW()*5-5+COLUMN()-2,0)"

With Range("B1:E" & Int(R / 5 + 0.5))
.Value = F
.Value = .Value
End With
Range("B:E").EntireColumn.AutoFit

End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



--
Regards,
Soo Cheon Jheong
_ _
^ąŻ^
--


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default reformatting data

Jeff,

The following code does what you want, I think.
For the example it is based on the source data being in column 2(B),
starting at Row 6 and the destination starting at Row 6, Column 4(D).

Sub ReLocate()
Dim SrceRw, DestRw
SrceRw = 6: DestRw = 6
Do
Range(Cells(SrceRw, 2), Cells(SrceRw + 3, 2)).Copy
Cells(DestRw, 4).PasteSpecial Paste:=xlPasteValues, Transpose:=True
SrceRw = SrceRw + 5: DestRw = DestRw + 1
Loop Until Cells(SrceRw, 2) = ""
End Sub

The loop ends when a blank name cell is encountered.
regards,
Don

"Jeff Gilstrap" wrote in message
...
I have an excel spreadsheet that has contact data in one
colume as follows:

name1
company1
street1
town, st zip 1
blank line
name2
company2
street2
town, st zip 2
blank line

each line is in a different row. I would like to import it
into an access table but the data is difficult to
manipulate now without manually copying and pasting cells.
Any ideas as to how I can manipulate this data into a more
user friendly format such as:

name1 company1 street1 town1 st1 zip1
name2 company2 street2 town2 st2 zip2

thanks much
Jeff G



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
Reformatting data Rick Excel Worksheet Functions 3 October 22nd 09 04:25 AM
reformatting input data field888 Excel Discussion (Misc queries) 0 April 16th 09 08:16 PM
Reformatting data and consolidating lcotner Excel Worksheet Functions 2 April 17th 08 07:40 PM
Data dissapears when reformatting a chart Nateman Charts and Charting in Excel 1 April 19th 06 10:14 AM
Data Formatting/Reformatting TimR Excel Discussion (Misc queries) 0 December 21st 05 04:14 PM


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