Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to copy specific number of rows from cells to cells?

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to copy specific number of rows from cells to cells?

Hi Eric

Try..

Range("V3").Resize(Range("U1").Value).Copy Range("A3")

--
Jacob (MVP - Excel)


"Eric" wrote:

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default How to copy specific number of rows from cells to cells?

When you say "text only"... do you mean cells with numbers should be
formatted as text, or is that your way of saying the cells you are copying
have formulas in them but you only want to copy the values the formulas are
displaying?

--
Rick (MVP - Excel)



"Eric" wrote in message
...
There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to copy specific number of rows from cells to cells?

What if I would like to copy a range V3:Z3,
For example
There is a given number in cell U1, which equals to 9, so
I would like to copy 9 rows starting from cell V3:Z3, which should copy from
V3:Z3 to V11:Z11 and paste text only into A3 to E11.

Does anyone have any suggestions?
Thank you very much for any suggestions
Eric


"Jacob Skaria" wrote:

Hi Eric

Try..

Range("V3").Resize(Range("U1").Value).Copy Range("A3")

--
Jacob (MVP - Excel)


"Eric" wrote:

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to copy specific number of rows from cells to cells?

Try the below...I hope you meant A3 to B11 and not A3 to E11.

Range("V3").Resize(Range("U1").Value,2).Copy Range("A3")

Also check out help on Resize() and Offset() functions....

--
Jacob (MVP - Excel)


"Eric" wrote:

What if I would like to copy a range V3:Z3,
For example
There is a given number in cell U1, which equals to 9, so
I would like to copy 9 rows starting from cell V3:Z3, which should copy from
V3:Z3 to V11:Z11 and paste text only into A3 to E11.

Does anyone have any suggestions?
Thank you very much for any suggestions
Eric


"Jacob Skaria" wrote:

Hi Eric

Try..

Range("V3").Resize(Range("U1").Value).Copy Range("A3")

--
Jacob (MVP - Excel)


"Eric" wrote:

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to copy specific number of rows from cells to cells?

After I try following code, and see the code display on running macro, but
text disappears after re-calucation, do you have any suggestions on what
wrong it is?
Thanks in advance for any suggestions
Eric

"Jacob Skaria" wrote:

Hi Eric

Try..

Range("V3").Resize(Range("U1").Value).Copy Range("A3")

--
Jacob (MVP - Excel)


"Eric" wrote:

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to copy specific number of rows from cells to cells?

Do you have any other worksheet/workbook events .. Try this in a new workbook
--
Jacob (MVP - Excel)


"Eric" wrote:

After I try following code, and see the code display on running macro, but
text disappears after re-calucation, do you have any suggestions on what
wrong it is?
Thanks in advance for any suggestions
Eric

"Jacob Skaria" wrote:

Hi Eric

Try..

Range("V3").Resize(Range("U1").Value).Copy Range("A3")

--
Jacob (MVP - Excel)


"Eric" wrote:

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to copy specific number of rows from cells to cells?

For values..

Range("V3").Resize(Range("U1").Value, 2).Copy
Range("A3").PasteSpecial xlPasteValues
Application.CutCopyMode = False

--
Jacob (MVP - Excel)


"Jacob Skaria" wrote:

Try the below...I hope you meant A3 to B11 and not A3 to E11.

Range("V3").Resize(Range("U1").Value,2).Copy Range("A3")

Also check out help on Resize() and Offset() functions....

--
Jacob (MVP - Excel)


"Eric" wrote:

What if I would like to copy a range V3:Z3,
For example
There is a given number in cell U1, which equals to 9, so
I would like to copy 9 rows starting from cell V3:Z3, which should copy from
V3:Z3 to V11:Z11 and paste text only into A3 to E11.

Does anyone have any suggestions?
Thank you very much for any suggestions
Eric


"Jacob Skaria" wrote:

Hi Eric

Try..

Range("V3").Resize(Range("U1").Value).Copy Range("A3")

--
Jacob (MVP - Excel)


"Eric" wrote:

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to copy specific number of rows from cells to cells?

Value only without formula
Thank everyone very much for suggestions
Eric

"Rick Rothstein" wrote:

When you say "text only"... do you mean cells with numbers should be
formatted as text, or is that your way of saying the cells you are copying
have formulas in them but you only want to copy the values the formulas are
displaying?

--
Rick (MVP - Excel)



"Eric" wrote in message
...
There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric


.

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to copy specific number of rows from cells to cells?

It works now, thank everyone very much for suggestions
Eric

"Jacob Skaria" wrote:

For values..

Range("V3").Resize(Range("U1").Value, 2).Copy
Range("A3").PasteSpecial xlPasteValues
Application.CutCopyMode = False

--
Jacob (MVP - Excel)


"Jacob Skaria" wrote:

Try the below...I hope you meant A3 to B11 and not A3 to E11.

Range("V3").Resize(Range("U1").Value,2).Copy Range("A3")

Also check out help on Resize() and Offset() functions....

--
Jacob (MVP - Excel)


"Eric" wrote:

What if I would like to copy a range V3:Z3,
For example
There is a given number in cell U1, which equals to 9, so
I would like to copy 9 rows starting from cell V3:Z3, which should copy from
V3:Z3 to V11:Z11 and paste text only into A3 to E11.

Does anyone have any suggestions?
Thank you very much for any suggestions
Eric


"Jacob Skaria" wrote:

Hi Eric

Try..

Range("V3").Resize(Range("U1").Value).Copy Range("A3")

--
Jacob (MVP - Excel)


"Eric" wrote:

There is a given number in cell U1, which equals to 9, so
I would like to copy 9 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A11.

If the given number in cell U1 is 6, then
I would like to copy 6 cells starting from cell V3, which should copy from
V3 to V11 and paste text only into A3 to A8.

Does anyone have any suggestions on how to code this macro in excel 2003?
Thanks in advance for any suggestions
Eric

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 cells to variable number of rows Acct Supr - DCTC Excel Discussion (Misc queries) 5 September 26th 09 12:58 PM
Copy specific cells to new rows Kathy - Lovullo Excel Programming 1 October 26th 07 07:19 PM
how can i automate the copy-insertion of a specific number of rows driller Excel Worksheet Functions 0 June 19th 07 10:41 PM
Count number of times a specific number is displayed in cells subs[_2_] Excel Programming 1 June 27th 05 03:15 PM
Macro to copy down specific number of rows JA Excel Programming 4 April 26th 04 01:37 PM


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