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

I am trying to write a macro that copies data (starting at column B(starting
at row 3), and going to end right) from one worksheet (Register) to another
(Sheet 1), and then repeats this on the data from the next row down on
worksheet Register until all data has been copied

I've been successful with the actual copying but have come unstuck on the
loop

Any help gratefully received
--
Neil
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Looping Macro

Hello Don

The data in worksheet 'Register' is document number (column B) and
associated document number(s) in columns C........to however many

I need to extract this data one row at a time and copy it to worksheet
'Sheet1' where I copy paste special transpose

I have cracked the copy paste special transpose part but have come unstuck
getting it to repeat one row at a time

The contents of worksheet 'Sheet1' is only intended to be temporary as it
will be created for a look up operation from a different worksheet as and
when needed


--
Neil


"Don Guillett" wrote:

before/after example(s)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
I am trying to write a macro that copies data (starting at column
B(starting
at row 3), and going to end right) from one worksheet (Register) to
another
(Sheet 1), and then repeats this on the data from the next row down on
worksheet Register until all data has been copied

I've been successful with the actual copying but have come unstuck on the
loop

Any help gratefully received
--
Neil



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Looping Macro

Sub copytransposecolstorows()
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row

With Sheets("sheet1") 'destination sheet
lc = Cells(i, Columns.Count).End(xlToLeft).Column
For j = 1 To lc
dlr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
Cells(i, j).Copy .Cells(dlr, "a")
Next j
End With

Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
Hello Don

The data in worksheet 'Register' is document number (column B) and
associated document number(s) in columns C........to however many

I need to extract this data one row at a time and copy it to worksheet
'Sheet1' where I copy paste special transpose

I have cracked the copy paste special transpose part but have come unstuck
getting it to repeat one row at a time

The contents of worksheet 'Sheet1' is only intended to be temporary as it
will be created for a look up operation from a different worksheet as and
when needed


--
Neil


"Don Guillett" wrote:

before/after example(s)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
I am trying to write a macro that copies data (starting at column
B(starting
at row 3), and going to end right) from one worksheet (Register) to
another
(Sheet 1), and then repeats this on the data from the next row down on
worksheet Register until all data has been copied

I've been successful with the actual copying but have come unstuck on
the
loop

Any help gratefully received
--
Neil




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Looping Macro

Thanks Don worked a treat
--
Neil


"Don Guillett" wrote:

Sub copytransposecolstorows()
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row

With Sheets("sheet1") 'destination sheet
lc = Cells(i, Columns.Count).End(xlToLeft).Column
For j = 1 To lc
dlr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
Cells(i, j).Copy .Cells(dlr, "a")
Next j
End With

Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
Hello Don

The data in worksheet 'Register' is document number (column B) and
associated document number(s) in columns C........to however many

I need to extract this data one row at a time and copy it to worksheet
'Sheet1' where I copy paste special transpose

I have cracked the copy paste special transpose part but have come unstuck
getting it to repeat one row at a time

The contents of worksheet 'Sheet1' is only intended to be temporary as it
will be created for a look up operation from a different worksheet as and
when needed


--
Neil


"Don Guillett" wrote:

before/after example(s)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
I am trying to write a macro that copies data (starting at column
B(starting
at row 3), and going to end right) from one worksheet (Register) to
another
(Sheet 1), and then repeats this on the data from the next row down on
worksheet Register until all data has been copied

I've been successful with the actual copying but have come unstuck on
the
loop

Any help gratefully received
--
Neil






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Looping Macro


Glad to help
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
Thanks Don worked a treat
--
Neil


"Don Guillett" wrote:

Sub copytransposecolstorows()
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row

With Sheets("sheet1") 'destination sheet
lc = Cells(i, Columns.Count).End(xlToLeft).Column
For j = 1 To lc
dlr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
Cells(i, j).Copy .Cells(dlr, "a")
Next j
End With

Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
Hello Don

The data in worksheet 'Register' is document number (column B) and
associated document number(s) in columns C........to however many

I need to extract this data one row at a time and copy it to worksheet
'Sheet1' where I copy paste special transpose

I have cracked the copy paste special transpose part but have come
unstuck
getting it to repeat one row at a time

The contents of worksheet 'Sheet1' is only intended to be temporary as
it
will be created for a look up operation from a different worksheet as
and
when needed


--
Neil


"Don Guillett" wrote:

before/after example(s)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Neil" wrote in message
...
I am trying to write a macro that copies data (starting at column
B(starting
at row 3), and going to end right) from one worksheet (Register) to
another
(Sheet 1), and then repeats this on the data from the next row down
on
worksheet Register until all data has been copied

I've been successful with the actual copying but have come unstuck
on
the
loop

Any help gratefully received
--
Neil





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
Looping Macro KimC Excel Discussion (Misc queries) 1 January 11th 10 04:55 AM
Looping Macro Jase Excel Discussion (Misc queries) 5 March 12th 08 09:08 PM
Looping a Macro Blue Stars Excel Programming 4 August 22nd 07 05:22 AM
Looping macro RK Excel Worksheet Functions 2 December 12th 06 11:29 PM
Looping macro furanku Excel Programming 1 September 25th 05 07:25 AM


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"