Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fastest way to do this?

I have 10000 logins and their respective passwords. Logins are in col A and
passwords are in B.
Logins contain serial no. like LGN00001 to LGN10000

What I want is to have the first 200 logins/ pwds on the first page like 1
to 50 in col A,b then 51 to 100 in C,D then 101 to 150 in E,F and 151 to 200
on G and H,

The same thing is repeated for the rest of logins. 201 to 250 on A,B etc.

any cool macro would help.

thx


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Fastest way to do this?

Here's a very straight-forward macro

Sub ReFormat()
Dim iSource As Long
Dim iTarget As Long

iSource = 1
iTarget = 1

Do
Cells(iSource, "A").Resize(50, 2).Cut Destination:=Cells(iTarget,
"A")
Cells(iSource + 50, "A").Resize(50, 2).Cut
Destination:=Cells(iTarget, "C")
Cells(iSource + 100, "A").Resize(50, 2).Cut
Destination:=Cells(iTarget, "E")
Cells(iSource + 150, "A").Resize(50, 2).Cut
Destination:=Cells(iTarget, "G")
iSource = iSource + 200
iTarget = iTarget + 51
Loop Until IsEmpty(Cells(iSource, "A").Value)

End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Abu Ali" wrote in message
...
I have 10000 logins and their respective passwords. Logins are in col A

and
passwords are in B.
Logins contain serial no. like LGN00001 to LGN10000

What I want is to have the first 200 logins/ pwds on the first page like 1
to 50 in col A,b then 51 to 100 in C,D then 101 to 150 in E,F and 151 to

200
on G and H,

The same thing is repeated for the rest of logins. 201 to 250 on A,B etc.

any cool macro would help.

thx




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Fastest way to do this?

If you are still interested in this issue...

You don't have to use a macro. Adapt the ideas in my posts at
http://www.mrexcel.com/board2/viewto...=340943#340943
and
http://www.mrexcel.com/board2/viewto...=341020#341020

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I have 10000 logins and their respective passwords. Logins are in col A and
passwords are in B.
Logins contain serial no. like LGN00001 to LGN10000

What I want is to have the first 200 logins/ pwds on the first page like 1
to 50 in col A,b then 51 to 100 in C,D then 101 to 150 in E,F and 151 to 200
on G and H,

The same thing is repeated for the rest of logins. 201 to 250 on A,B etc.

any cool macro would help.

thx



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Fastest way to do this?

Sub MoveLogons()

Dim firstrow As Long, lastrow As Long, cl As Long

cl = 1 ' initialise target column

For firstrow = 1 To 10000 Step 200
lastrow = firstrow + 199
cl = cl + 1

Range(Cells(1, cl), Cells(200, cl)).Value = _
Range(Cells(firstrow, 1), Cells(lastrow, 1)).Value

Next

End Sub

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
I have 10000 logins and their respective passwords.

Logins are in col A and
passwords are in B.
Logins contain serial no. like LGN00001 to LGN10000

What I want is to have the first 200 logins/ pwds on the

first page like 1
to 50 in col A,b then 51 to 100 in C,D then 101 to 150

in E,F and 151 to 200
on G and H,

The same thing is repeated for the rest of logins. 201

to 250 on A,B etc.

any cool macro would help.

thx


.

  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Fastest way to do this?

Abu,

Not necessarily the fastest way.
Your Logons/Passwords should be in Worksheets(1) (or in a different workbook
alrogether!), if they're not then the list will overwrite itself.

Sub testit()
Const cPerColumn = 50, cPerWorksheet = 200, cSourceCols = 2
Dim i As Long, lngLastRow As Long, wks As Worksheet

Set wks = Sheet1

On Error GoTo NoMoreSheets
lngLastRow = wks.Cells(1, 1).End(xlDown).Row
For i = 0 To lngLastRow - 1 Step cPerColumn
Worksheets(i \ cPerWorksheet + 1).Cells(1, (i Mod cPerWorksheet) /
cPerColumn * cSourceCols + 1).Resize(cPerColumn, cSourceCols).Value =
wks.Cells(i + 1, 1).Resize(cPerColumn, cSourceCols).Value
Next
On Error GoTo 0
Exit Sub

NoMoreSheets:
With Worksheets: .Add After:=.Item(.Count): End With
Resume
End Sub


Rob

"Abu Ali" wrote in message
...
I have 10000 logins and their respective passwords. Logins are in col A

and
passwords are in B.
Logins contain serial no. like LGN00001 to LGN10000

What I want is to have the first 200 logins/ pwds on the first page like 1
to 50 in col A,b then 51 to 100 in C,D then 101 to 150 in E,F and 151 to

200
on G and H,

The same thing is repeated for the rest of logins. 201 to 250 on A,B etc.

any cool macro would help.

thx




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
Macros or the Fastest way to Autofill Rows klafert Excel Discussion (Misc queries) 1 September 30th 06 09:04 PM
Repeating a Cell Format For Many Rows: What's Fastest Way? TomBrooklyn Excel Discussion (Misc queries) 3 November 2nd 05 02:51 PM
What is fastest for this? The Small VBA or many Worksheet Functions...? Maria J-son Excel Worksheet Functions 0 August 10th 05 08:24 AM
What is fastest way to print labels from Excel data? Janis New Users to Excel 1 April 12th 05 10:37 PM
Fastest Way to Filter/Delete SyrHoop Excel Worksheet Functions 6 November 10th 04 06:33 PM


All times are GMT +1. The time now is 08:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"