Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Macro to rotate data in cells

I have a worksheet that includes data on medical resident students. Each
student will rotate through 12 different departments in a year. Is there away
to create a macro that will automatically shift the departments for each
month so that the cell data shifts down one cell and to the right one cell?
The last cell in a row would need to move to the first cell in the next
column. Example:

Doctor Jan Feb Mar Apr May June
Smith IM Ortho Peds Neuro OB Surgery
Thomas Surgery IM
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Macro to rotate data in cells



"Sue" wrote:

I have a worksheet that includes data on medical resident students. Each
student will rotate through 12 different departments in a year. Is there away
to create a macro that will automatically shift the departments for each
month so that the cell data shifts down one cell and to the right one cell?
The last cell in a row would need to move to the first cell in the next column. Example:

Doctor Jan Feb Mar Apr May June
Smith IM Ortho Peds Neuro OB Surgery
Thomas Surgery IM Ortho Peds Neuro OB


Sorry - I was not finished sending my example. Thank you for your help.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro to rotate data in cells

Hi Sue,

Does this do it

Sub MoveData()
Dim iLastRow As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
sSave = Cells(iLastRow, 13).Value
Range("B2:M" & iLastRow).Cut Destination:=Range("C3")
Range("N3:N" & iLastRow + 1).Cut Destination:=Range("B2")
Range("C" & iLastRow + 1 & ":N" & iLastRow + 1).Cut
Destination:=Range("C2")

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Sue" wrote in message
...
I have a worksheet that includes data on medical resident students. Each
student will rotate through 12 different departments in a year. Is there

away
to create a macro that will automatically shift the departments for each
month so that the cell data shifts down one cell and to the right one

cell?
The last cell in a row would need to move to the first cell in the next
column. Example:

Doctor Jan Feb Mar Apr May June
Smith IM Ortho Peds Neuro OB Surgery
Thomas Surgery IM



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
how do I rotate the cells containing col. hds to a 65 degree angl Fripp Man Setting up and Configuration of Excel 1 November 28th 09 06:42 PM
How do i rotate data - see below AdrianCoyte Excel Discussion (Misc queries) 6 March 21st 07 09:10 PM
is it possible to rotate a group of cells? Shivaraj Excel Discussion (Misc queries) 1 August 24th 06 01:14 AM
How do I rotate Horazontial cells vertical, so part of the chart . Wendol Excel Worksheet Functions 2 May 22nd 05 10:42 PM
How I do I rotate text in an excel cell? The rotate commands is g. MickG Excel Discussion (Misc queries) 3 December 13th 04 08:14 PM


All times are GMT +1. The time now is 09:48 PM.

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"