Need to convert/transpose single column of addresses to separate columns (name, city, state, etc.), but not all addresses have the same number of rows

Myhobohemia

Board Regular
Joined
Mar 12, 2020
Messages
54
Office Version
  1. 365
Platform
  1. Windows
HI there. As I said in the subject line, I need to convert a single column of addresses and transpose them into their separate fields. This would be fairly easy, except that the number of rows is irregular, ranging from 6-13 rows. Most are about 7 or 8. I can't figure out how to automate this. Right now, the individual addresses in the column are not separated by anything. The last row of each address is a hyperlink, for what it's worth (and hyperlinks are searchable using the search feature, I learned yesterday, but to no avail). I have never done a macro or used VBA in my life! :oops: I can, however, follow clear instructions. ? I have dozens of separate documents, some with hundreds of addresses, some with only a handful. The worstcase scenario would be to have to transpose each address manually. But I'd like to avoid it, particularly since it looks like there will still be plenty of manual work later, getting everything into the right column. Any suggestions?! Thanks in advance. Attaching an image of the data.
 

Attachments

  • 20.03.12  Address data that needs to be transposed.JPG
    20.03.12 Address data that needs to be transposed.JPG
    54.2 KB · Views: 49
Bingo. :rolleyes: :biggrin: I just moved it. Now what? I closed the Excel file, and reopened it. Still no MrExcel tab, and nothing else appears to have changed.

1584132831720.png
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You may need to unblock it again & then in Xl deselect it in the add-in tab on the developer ribbon & then reselect it again
 
Upvote 0
Ok, so it was still unblocked (when I select the file, right click "Properties"). So I deselected it in Excel Add-ins and re-selected, and... TA-DA! Mr. Excel appeared! :biggrin: Thank you for your patience! ?

So here's a sample of the data after I ran the code you gave me. All this was with one click!

GEORGIA.xlsm
ABCDEFGHIJKLMNOPQ
1City of Hope Heart and VascularCity of Hope Heart and Vascular207 Fairview Park DriveSuite ADublin, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jun 29, 2020City of Hope Heart and Vascular
2207 Fairview Park DriveMeyer Cardiology112 Corporate SquareDublin, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jul 31, 2022Meyer Cardiology
3Suite AUND-Cardiopulmonary Associates1031 Keth DrivePerry, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jun 29, 2020UND-Cardiopulmonary Associates
4Dublin, GANT Cardiovascular Center1117 Morningside DrivePerry, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jun 29, 2020NT Cardiovascular Center
5Nuclear/PET: Myocardial Perfusion ImagingAdvanced Medical Associates1282 South Houston Lake RoadWarner Robins, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Apr 30, 2021www.advamed.org/
6Accredited Through: Jun 29, 2020Madalyn N. Davidoff, MD, LLC1570 Watson BoulevardWarner Robins, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jun 30, 2020Madalyn N. Davidoff, MD, LLC
7City of Hope Heart and VascularHOUSTON PRIMARY CARE1719 RUSSELL PARKWAY BLDG 700WARNER ROBINS, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Apr 30, 2021HOUSTON PRIMARY CARE
8Meyer CardiologyMeyer Cardiology312 Margie DriveWarner Robins, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jul 31, 2022Meyer Cardiology
9112 Corporate SquarePrime Medical Associates, Inc.305 Osigian BlvdWarner Robins, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Apr 30, 2021Prime Medical Associates, Inc.
10Dublin, GATifton Cardiovascular, LLC1499 Kennedy RdSuite CTifton, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Oct 31, 2020Tifton Cardiovascular, LLC
11Nuclear/PET: Myocardial Perfusion ImagingMacon Electrophysiology Associates639 Hemlock St, Ste 100Macon, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Apr 30, 2021www.gacri.com
12Accredited Through: Jul 31, 2022Georgia Heart Physicians, LLC (Macon)654 First StreetMacon, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: May 30, 2020ghphysicians.com
13Meyer CardiologyMeyer Cardiology, P.C360 Hospital DriveBuilding D, Suite 200Macon, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jul 31, 2022Meyer Cardiology, P.C
14UND-Cardiopulmonary AssociatesCentral Georgia Heart Center1062 Forsyth StreetSuite 1BMacon, GANuclear/PET: Positron Emission Tomography (PET), Myocardial Perfusion ImagingAccredited Through: Jan 31, 2021Central Georgia Heart Center
151031 Keth DriveGeorgia Heart Physicians,LLC ( Fort Valley)105 Avera DriveFort Valley, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: May 30, 2020www.gaheartphysicians.com
16Perry, GAHeart of Georgia Cardiology2064 Vineville AvenueMacon, GANuclear/PET: Myocardial Perfusion Imaging, Equilibrium Radionuclide AngiographyAccredited Through: May 31, 2021Heart of Georgia Cardiology
17Nuclear/PET: Myocardial Perfusion ImagingSoutheastern Cardiovascular Associates1076 Bermuda Run RoadStatesboro, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jan 31, 2021Southeastern Cardiovascular Associates
18Accredited Through: Jun 29, 2020Cardiovascular Associates of Eastern Georgia1497 Fair RoadSuite 305Statesboro, GANuclear/PET: Equilibrium Radionuclide Angiography, Myocardial Perfusion ImagingAccredited Through: Aug 31, 2020Cardiovascular Associates of Eastern Georgia
19UND-Cardiopulmonary AssociatesKendall Griffith, MD, LLC1497 Fair RoadSuite 311Statesboro, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jan 31, 2021Kendall Griffith, MD, LLC
20NT Cardiovascular CenterStatesboro Cardiology, PC5 Grady Johnson RoadStatesboro, GAVascular: Peripheral Venous TestingAccredited Through: May 31, 2021Nuclear/PET: Myocardial Perfusion ImagingAccredited Through: Feb 28, 2021Statesboro Cardiology, PC
211117 Morningside DriveSt. Vincent’s Ambulatory Care, Inc.615 Pendleton StreetSuite BWaycross, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: May 31, 2021St. Vincent’s Ambulatory Care, Inc.
22Perry, GAColquitt Regional Medical Center3131 South Main StreetMoultrie, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jan 31, 2022Colquitt Regional Medical Center
23Nuclear/PET: Myocardial Perfusion ImagingAtlanta Heart Associates Jackson Office1502 West 3rd Street, Suite DJackson, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Sep 30, 2021Atlanta Heart Associates Jackson Office
24Accredited Through: Jun 29, 2020Saint Joseph’s Hospital11700 Mercy BoulevardPlaza D Suite 6Savannah, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Dec 31, 2022Saint Joseph’s Hospital
25NT Cardiovascular CenterUniversity Cardiology Associates4350 Towne Center DriveMOB 4 Suite 3101Evans, GANuclear/PET: Positron Emission Tomography (PET)Accredited Through: Dec 31, 2020University Cardiology Associates
26Advanced Medical AssociatesUniversity Hospital Cardiac Imaging of Evans4350 Towne Center DriveSuite 3100Evans, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Dec 31, 2020University Hospital Cardiac Imaging of Evans
271282 South Houston Lake RoadHeart and Vascular Associates of Augusta820 St. Sebastian WaySuite 2AAugusta, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Mar 31, 2021Heart and Vascular Associates of Augusta
28Warner Robins, GAUniversity Hospital Cardiac Imaging of Augusta818 St. Sebastian WaySuite 305Augusta, GANuclear/PET: Positron Emission Tomography (PET), Myocardial Perfusion ImagingAccredited Through: Dec 31, 2020University Hospital Cardiac Imaging of Augusta
29Nuclear/PET: Myocardial Perfusion ImagingUniversity Hospital Cardiovascular Imaging1350 Walton WaySuite 5300Augusta, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Dec 31, 2020University Hospital Cardiovascular Imaging
30Accredited Through: Apr 30, 2021University Hospital CVP Lab1350 Walton WayCVP DiagnosticsAugusta, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Dec 31, 2020University Hospital CVP Lab
31www.advamed.org/Memorial Heart Care - Abercorn6301 Abercorn StreetSavannah, GANuclear/PET: Myocardial Perfusion ImagingAccredited Through: Jun 30, 2020memorialhealth.com/
Sheet1
 
Upvote 0
First, to wrap up where we were before. The mistake I was making was trying to create a macro from "Macro." I did not realize I had to go to "Visual Basic / Insert Module." Instead, I was going to "Macros" and writing a new name in the field, which would make the greyed-out "create" button suddenly activate. Still, this was a mess. At one point I even created fake macros (making useless movements like widening columns) so that I could save, "edit," and replace the code. But it was still a mess. [I'm writing this out in case another total beginner ever ends up on this thread].

As it is now, the macro needs only three teensy things to be a perfect, one-click, nothing manual solution. I'm mentioning them only because, well, we've come this far! :biggrin:? But even if I have to do them manually, it will take only a couple of minutes at most.

1) Move the state initials ("GA") into a separate column.
2) Remove "Accredited Through:" wherever it appears (I will make that a column heading instead).
3) Remove columns J,K,L,M,N,O,P which appear to be there for no reason.

If you can be bothered to do this, fantastic, but please believe me when I say: I'm already eternally grateful. !
 
Upvote 0
Would you be willing to upload the workbook to a share site such as OneDrive.
If so mark it for sharing & post the link you get to the thread.
With the 5 sets of data I get the links all lined up in col H
 
Upvote 0
Many thanks for that, the problem is that in A648 on the Georgia shaeet you do not have a hyperlink, so two sets of data are being put on one line
 
Upvote 0
How about
VBA Code:
Sub myhobohemia()
   Dim StartRng As Range, Rng As Range, Cl As Range
   Dim i As Long, Mx As Long
   
   Application.ScreenUpdating = False
   Set StartRng = Range("A1")
   For Each Cl In Range("A1", Range("A" & Rows.Count).End(xlUp))
      If Cl.Hyperlinks.Count = 1 Then
         i = i + 1
         Set Rng = Range(StartRng, Cl)
         Range("B" & i).Resize(, Rng.Count).Value = Application.Transpose(Rng)
         Cl.Copy Cells(i, Rng.Count + 1)
         Set StartRng = Cl.Offset(1)
      End If
   Next Cl
   For Each Rng In Range("E1", Range("E" & Rows.Count).End(xlUp))
      If InStr(1, Rng, ":") > 0 Then Rng.Offset(, -1).Insert xlToRight
   Next Rng
   Range("F:F").Insert
   With Range("E:E")
      .Replace ", ", ",", xlPart, , , , False, False
      .TextToColumns Range("E1"), xlDelimited, xlDoubleQuote, , False, _
         False, True, False, False
   End With
   Mx = Cells.Find("*", , , , xlByColumns, xlPrevious, , , False).Column
   With Range("G1", Cells(1, Mx - 1)).EntireColumn
      Do Until .Hyperlinks.Count = 0
         .Hyperlinks(1).Range.Resize(, Mx - .Hyperlinks(1).Range.Column).Insert xlToRight
      Loop
   End With
   With Range("H1", Cells(1, Mx - 1)).EntireColumn
      .Replace "Accredited Through: ", "", xlPart, , False, , False, False
   End With
End Sub
 
Upvote 0
Hello! Sorry for delay in responding. It's great! Worked like a charm. :biggrin: Thank you!

I still have to some minor touch-ups to those "outlier" practices which have multiple accreditations when all the others have no more than two, and some minimal formatting, but I expected this. The lion's share is done!

This is what it will all look like when duly formatted, with the columns in the right places. Note that I inserted a blank "Zip Code" column.

Order
No.
Practice NameStreet AddressAddress line 2CityStateZip CodeWeb link Accred1Accred1 DateAccred2Accred2 DateAccred3Accred3 DateAccred4Accred4 Date
1Selma Family Care, PC203 Vaughan Memorial DriveSelmaALSelma Family Care, PCNuclear/PET: Myocardial Perfusion ImagingApr 30, 2021
2Charlton Trinidad, M.D.1739 East Main StreetSuite AbPrattvilleALCharlton Trinidad, M.D.Nuclear/PET: Myocardial Perfusion ImagingApr 30, 2021
3MEDICAL CARE ASSOCIATES PRATTVILLE102 MEDICAL CENTER DR SUITE APrattvilleALMEDICAL CARE ASSOCIATES PRATTVILLENuclear/PET: Myocardial Perfusion ImagingApr 30, 2021
4Primary Care Internists1722 Pine StreetMontgomeryALPrimary Care InternistsNuclear/PET: Myocardial Perfusion ImagingApr 30, 2021
5John K. L. Porter, D.O., PC1758 Park Pl Suite 100MontgomeryALJohn K. L. Porter, D.O., PCNuclear/PET: Myocardial Perfusion ImagingApr 30, 2021
6William O. Sargeant, PC1758 Park Pl Suite 100MontgomeryALWilliam O. Sargeant, PCNuclear/PET: Myocardial Perfusion ImagingApr 30, 2021
7Mulberry Medical Associates1301 Mulberry StreetMontgomeryALMulberry Medical AssociatesNuclear/PET: Myocardial Perfusion ImagingApr 30, 2021

My question is this. Are you familiar with an easy way to get zip codes to autopopulate? Google Sheets offers this apparently. But I would need to copy everything into Google and follow these instructions.
Before I do this, I wanted to check whether anyone knew an easier way. Otherwise, I will just use this Google Sheets method.
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,790
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top