Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to copy cell from one worksheet to another

Hi I currently have a workbook that contains two worksheets 'results' and
'data'

The information currently runs in two rows across the page a1, b1, c1, d1,
e1 etc. needs to become a1, a2, a3, a4, a5

and a2, b2, c2, d2, e2, needs to become b1, b2, b3, b4, b5 etc.

Any suggestions on the easiest way to do this?

Cheers,

Allan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to copy cell from one worksheet to another

Hello,

I think you can do this via a Paste function with the Transpose
indication = True.

I have recorded a small macro which does this job.

Sheets("Sheet1").Select
Range("A1:C3").Select
Selection.Copy
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteAll, peration:=xlNone, SkipBlanks:=
False, Transpose:=True

kind regards,

Filip Henderieckx

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Macro to copy cell from one worksheet to another

Option Explicit
Sub Macro1()
Dim iNumRows As Integer, iNumCol As Integer, r As Integer, c As Integer
iNumRows = Sheets("data").UsedRange.Rows.Count
iNumCol = Sheets("data").UsedRange.Columns.Count
For r = 1 To iNumRows
For c = 1 To iNumCol
Sheets("result").Cells(c, r) = Sheets("data").Cells(r, c)
Next
Next

End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to copy cell from one worksheet to another

Ta guys, both really helped me out of a sticky situation.

Cheers,

Allan

"allanb" wrote:

Hi I currently have a workbook that contains two worksheets 'results' and
'data'

The information currently runs in two rows across the page a1, b1, c1, d1,
e1 etc. needs to become a1, a2, a3, a4, a5

and a2, b2, c2, d2, e2, needs to become b1, b2, b3, b4, b5 etc.

Any suggestions on the easiest way to do this?

Cheers,

Allan

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
copy from worksheet in macro Darrell_Sarrasin via OfficeKB.com Excel Discussion (Misc queries) 2 May 4th 09 01:44 PM
Copy Macro with Worksheet Kersten Excel Discussion (Misc queries) 4 April 3rd 09 05:36 PM
VB Macro to Copy from Worksheet KCG Excel Discussion (Misc queries) 1 September 2nd 07 08:46 AM
Macro to copy worksheet clarknv Excel Discussion (Misc queries) 2 June 17th 07 08:42 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM


All times are GMT +1. The time now is 03:41 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"