Zdaj imam napisano v takšnem stilu
------ A ------
1 ime priimek
2 naslov
3 pošta kraj
4
5 ime priimek
6 naslov
7 pošta kraj
8
9
10 ime priimek
11 naslov
12 pošta kraj
imel pa bi rad takole:
------ A -------------- B -------------- C -----
1 ime priimek ---- naslov ----- pošta kraj
2 ime priimek ---- naslov ----- pošta kraj
3 ime priimek ---- naslov ----- pošta kraj
Število praznih vrstic med podatki ni vedno enak včasih so 2 včasih 1 včasih 3.
Kako tudi zbrisati te prazne vrstice to je pa drug problem?
Havala!
Gorazd
Drugačne vrste zapis
Samo z makrom:
Ups. Zgornji makro je malce napačen. Spodnji je/bo pravilen.
MAKRO:
Koda: Izberi vse
Sub Razvrsti()
On Error GoTo Err
Dim trenutenStolpec As Integer
Dim trenutnaVrstica As Integer
trenutnaVrstica = 1
trenutenStolpec = 1
Do While True
Do Until Not Range("A" & trenutnaVrstica).Value = ""
trenutnaVrstica = trenutnaVrstica + 1
Loop
Range("A" & trenutnaVrstica & ":A" & trenutnaVrstica + 2).Select
Selection.Cut
Cells(1, trenutenStolpec).Select
ActiveSheet.Paste
trenutnaVrstica = trenutnaVrstica + 3
trenutenStolpec = trenutenStolpec + 1
Loop
Err:
Exit Sub
End Sub
MAKRO:
Koda: Izberi vse
Sub Razvrsti()
On Error GoTo Err
Dim trenutnaVrstica As Integer
Dim trenutnaVrstica1 As Integer
trenutnaVrstica = 1
trenutnaVrstica1 = 1
Do While True
Do Until Not Range("A" & trenutnaVrstica).Value = ""
trenutnaVrstica = trenutnaVrstica + 1
Loop
Range("A" & trenutnaVrstica).Select
Selection.Cut
Cells(trenutnaVrstica1, 1).Select
ActiveSheet.Paste
Range("A" & trenutnaVrstica + 1).Select
Selection.Cut
Cells(trenutnaVrstica1, 2).Select
ActiveSheet.Paste
Range("A" & trenutnaVrstica + 2).Select
Selection.Cut
Cells(trenutnaVrstica1, 3).Select
ActiveSheet.Paste
trenutnaVrstica = trenutnaVrstica + 3
trenutnaVrstica1 = trenutnaVrstica1 + 1
Loop
Err:
Exit Sub
End Sub
[img]http://shrani.si/f/3t/YL/4W2P37B9/office.gif[/img]
[img]http://shrani.si/f/12/aa/1rt1wj6i/1/userbardionaea.gif[/img]
[img]http://shrani.si/f/3D/nN/3RQySBCl/vista-copy.gif[/img]
[img]http://shrani.si/f/12/aa/1rt1wj6i/1/userbardionaea.gif[/img]
[img]http://shrani.si/f/3D/nN/3RQySBCl/vista-copy.gif[/img]