PDA

View Full Version : How to fix a messed Excel sheet and make a proper format?



mkanzari
10-14-2020, 08:07 AM
I have a problem in a specific sheet: I need only country,network,NetworkName and currency columns, but in sheet all messed up. As you can see in network Colum there are name and MCCMNC code also same in network name Colum so basically I need to separate all data and make proper format by switching places between the content of the following columns: "Network" and "NetworkName" from line 14. Please refer to the following screenshots to explain more the situation:
2731127312

jolivanes
10-14-2020, 12:29 PM
Sub Maybe()
Dim netw, netwName
netw = Range("C14:C" & Cells(Rows.Count, 3).End(xlUp).Row).Value
netwName = Range("E14:E" & Cells(Rows.Count, 5).End(xlUp).Row).Value
Range("C14").Resize(UBound(netwName)).Value = netwName
Range("E14").Resize(UBound(netw)).Value = netw
End Sub
Or you can just insert cells, copy them into the right place and delete the non needed cells.