Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Move Data from one group of cells to another

Hi Guys

I have an excel spreadsheet that contains data in the following format.
row 5 has in column A a row heading, row 6 another column heading etc down
36 rows.

I want to be able to move data along the row leaving the row heading and
paste it into another row again leaving the row heading. ie cut and paste.

the problem is multiple people will be using this spreadsheet with limited
PC/Excel skills.

So i would like to be able to prompt the user to say move the data from row
5 and paste it into row 34 using an input box.

eg if you wanted to move the data from row 5 it would be B5:H8 then paste it
into row 34 into B34:H34. With the user just entering 5 for "row 5" in the
from input and entering 34 for "row34" for the to input, the field range is a
constant its just the row that changes.

hope that makes sense, and that someone can help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Move Data from one group of cells to another

in my example the FROM row number is in C1 and the TO row number is in C2.
Mytable starts in E and is 11 columns

Option Explicit

Sub MoveData()
Dim FROMrow As Long
Dim TOrow As Long

FROMrow = Range("C1")
TOrow = Range("C2")

Cells(FROMrow, "E").Resize(, 11).Copy
Cells(TOrow, "E").PasteSpecial xlPasteAll
Application.CutCopyMode = False

End Sub


"David Ryan" wrote:

Hi Guys

I have an excel spreadsheet that contains data in the following format.
row 5 has in column A a row heading, row 6 another column heading etc down
36 rows.

I want to be able to move data along the row leaving the row heading and
paste it into another row again leaving the row heading. ie cut and paste.

the problem is multiple people will be using this spreadsheet with limited
PC/Excel skills.

So i would like to be able to prompt the user to say move the data from row
5 and paste it into row 34 using an input box.

eg if you wanted to move the data from row 5 it would be B5:H8 then paste it
into row 34 into B34:H34. With the user just entering 5 for "row 5" in the
from input and entering 34 for "row34" for the to input, the field range is a
constant its just the row that changes.

hope that makes sense, and that someone can help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Move Data from one group of cells to another

Hi Patrick
Got a compile error.

although this look like it will work.

next question if i may, how do i get which row to apply this to, from a user
input box?

"Patrick Molloy" wrote:

in my example the FROM row number is in C1 and the TO row number is in C2.
Mytable starts in E and is 11 columns

Option Explicit

Sub MoveData()
Dim FROMrow As Long
Dim TOrow As Long

FROMrow = Range("C1")
TOrow = Range("C2")

Cells(FROMrow, "E").Resize(, 11).Copy
Cells(TOrow, "E").PasteSpecial xlPasteAll
Application.CutCopyMode = False

End Sub


"David Ryan" wrote:

Hi Guys

I have an excel spreadsheet that contains data in the following format.
row 5 has in column A a row heading, row 6 another column heading etc down
36 rows.

I want to be able to move data along the row leaving the row heading and
paste it into another row again leaving the row heading. ie cut and paste.

the problem is multiple people will be using this spreadsheet with limited
PC/Excel skills.

So i would like to be able to prompt the user to say move the data from row
5 and paste it into row 34 using an input box.

eg if you wanted to move the data from row 5 it would be B5:H8 then paste it
into row 34 into B34:H34. With the user just entering 5 for "row 5" in the
from input and entering 34 for "row34" for the to input, the field range is a
constant its just the row that changes.

hope that makes sense, and that someone can help

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Move Data from one group of cells to another

I thought using tow cells would be easiest

amended:

Option Explicit
Sub MoveData()
Dim FROMrow As Long
Dim TOrow As Long

FROMrow = InputBox("FROM row:", "COPY DATA FROM...")
TOrow = InputBox("TO row:", "COPY DATA TO...")

Cells(FROMrow, "E").Resize(, 11).Copy
Cells(TOrow, "E").PasteSpecial xlPasteAll
Application.CutCopyMode = False
Cells(FROMrow, "E").Resize(, 11).ClearContents
End Sub


This code should be fine - What is the compile error? My code comes from my
Excel 2003 test worksheet.

"David Ryan" wrote:

Hi Patrick
Got a compile error.

although this look like it will work.

next question if i may, how do i get which row to apply this to, from a user
input box?

"Patrick Molloy" wrote:

in my example the FROM row number is in C1 and the TO row number is in C2.
Mytable starts in E and is 11 columns

Option Explicit

Sub MoveData()
Dim FROMrow As Long
Dim TOrow As Long

FROMrow = Range("C1")
TOrow = Range("C2")

Cells(FROMrow, "E").Resize(, 11).Copy
Cells(TOrow, "E").PasteSpecial xlPasteAll
Application.CutCopyMode = False

End Sub


"David Ryan" wrote:

Hi Guys

I have an excel spreadsheet that contains data in the following format.
row 5 has in column A a row heading, row 6 another column heading etc down
36 rows.

I want to be able to move data along the row leaving the row heading and
paste it into another row again leaving the row heading. ie cut and paste.

the problem is multiple people will be using this spreadsheet with limited
PC/Excel skills.

So i would like to be able to prompt the user to say move the data from row
5 and paste it into row 34 using an input box.

eg if you wanted to move the data from row 5 it would be B5:H8 then paste it
into row 34 into B34:H34. With the user just entering 5 for "row 5" in the
from input and entering 34 for "row34" for the to input, the field range is a
constant its just the row that changes.

hope that makes sense, and that someone can help

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Move Data from one group of cells to another

Hi Patrick worked a treat. Thanks

"Patrick Molloy" wrote:

I thought using tow cells would be easiest

amended:

Option Explicit
Sub MoveData()
Dim FROMrow As Long
Dim TOrow As Long

FROMrow = InputBox("FROM row:", "COPY DATA FROM...")
TOrow = InputBox("TO row:", "COPY DATA TO...")

Cells(FROMrow, "E").Resize(, 11).Copy
Cells(TOrow, "E").PasteSpecial xlPasteAll
Application.CutCopyMode = False
Cells(FROMrow, "E").Resize(, 11).ClearContents
End Sub


This code should be fine - What is the compile error? My code comes from my
Excel 2003 test worksheet.

"David Ryan" wrote:

Hi Patrick
Got a compile error.

although this look like it will work.

next question if i may, how do i get which row to apply this to, from a user
input box?

"Patrick Molloy" wrote:

in my example the FROM row number is in C1 and the TO row number is in C2.
Mytable starts in E and is 11 columns

Option Explicit

Sub MoveData()
Dim FROMrow As Long
Dim TOrow As Long

FROMrow = Range("C1")
TOrow = Range("C2")

Cells(FROMrow, "E").Resize(, 11).Copy
Cells(TOrow, "E").PasteSpecial xlPasteAll
Application.CutCopyMode = False

End Sub


"David Ryan" wrote:

Hi Guys

I have an excel spreadsheet that contains data in the following format.
row 5 has in column A a row heading, row 6 another column heading etc down
36 rows.

I want to be able to move data along the row leaving the row heading and
paste it into another row again leaving the row heading. ie cut and paste.

the problem is multiple people will be using this spreadsheet with limited
PC/Excel skills.

So i would like to be able to prompt the user to say move the data from row
5 and paste it into row 34 using an input box.

eg if you wanted to move the data from row 5 it would be B5:H8 then paste it
into row 34 into B34:H34. With the user just entering 5 for "row 5" in the
from input and entering 34 for "row34" for the to input, the field range is a
constant its just the row that changes.

hope that makes sense, and that someone can help

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
If condition to move a group of cells based on status Very Basic User Excel Discussion (Misc queries) 7 July 1st 09 05:54 PM
move cells based on group levels research-assistant Excel Discussion (Misc queries) 1 January 25th 08 07:43 PM
Copy Data from One Group of Cells to Another Group Alan Auerbach Charts and Charting in Excel 2 May 27th 07 04:12 PM
WHEN I GROUP IT ERRORS WITH 'CANNOT MOVE CELLS OFF WORKSHEET?? Irene Excel Worksheet Functions 0 August 24th 06 01:23 AM
Have VBA delete a group of cells, move information over, then add Tina Bradshaw Excel Discussion (Misc queries) 0 February 22nd 06 04:07 PM


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