PC Review


Reply
Thread Tools Rate Thread

How to copy specific number of rows from cells to cells?

 
 
Eric
Guest
Posts: n/a
 
      30th Apr 2010
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 With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      30th Apr 2010
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 With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      30th Apr 2010
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" <(E-Mail Removed)> wrote in message
news:B7278965-9B70-4C51-A512-(E-Mail Removed)...
> 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 With Quote
 
Eric
Guest
Posts: n/a
 
      30th Apr 2010
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 With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      30th Apr 2010
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 With Quote
 
Eric
Guest
Posts: n/a
 
      30th Apr 2010
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

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      30th Apr 2010
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

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      30th Apr 2010
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 With Quote
 
Eric
Guest
Posts: n/a
 
      30th Apr 2010
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" <(E-Mail Removed)> wrote in message
> news:B7278965-9B70-4C51-A512-(E-Mail Removed)...
> > 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 With Quote
 
Eric
Guest
Posts: n/a
 
      30th Apr 2010
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy cells to variable number of rows =?Utf-8?B?QWNjdCBTdXByIC0gRENUQw==?= Microsoft Excel Misc 5 26th Sep 2009 12:58 PM
sumif for a specific number of cells simon1982 Microsoft Excel Misc 2 20th Jan 2009 03:05 PM
Copy specific cells to new rows =?Utf-8?B?S2F0aHkgLSBMb3Z1bGxv?= Microsoft Excel Programming 1 26th Oct 2007 07:19 PM
Count number of times a specific number is displayed in cells =?Utf-8?B?c3Vicw==?= Microsoft Excel Programming 1 27th Jun 2005 03:15 PM
Macro to copy down specific number of rows JA Microsoft Excel Programming 4 26th Apr 2004 01:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:54 PM.