Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JA JA is offline
external usenet poster
 
Posts: 13
Default Macro to copy down specific number of rows

Cell A1 contains Username and cell B1 contains a number
indicating how many times the names should be replicated
in the database.

Please help with a macro to do this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Macro to copy down specific number of rows

Cell A1 contains Username and cell B1 contains a number
indicating how many times the names should be replicated
in the database.


try this:

Range("A2:A" & Range("B1").Value).Value = Range("A1").Value

--
Mit freundlichen Grüssen

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Macro to copy down specific number of rows

Cell A1 contains Username and cell B1 contains a number
indicating how many times the names should be replicated
in the database.


I forgot a value:
Range("A2:A" & Range("B1").Value + 1).Value = Range("A1").Value

--
Mit freundlichen Grüssen

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to copy down specific number of rows

Using Resize might be clearer in terms of intent. Just offered for
consideration.

Range("A2").Resize(Range("B1").Value ,1).Value = Range("A1").Value



--
Regards,
Tom Ogilvy


"Melanie Breden" wrote in message
...
Cell A1 contains Username and cell B1 contains a number
indicating how many times the names should be replicated
in the database.


I forgot a value:
Range("A2:A" & Range("B1").Value + 1).Value = Range("A1").Value

--
Mit freundlichen Grüssen

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Macro to copy down specific number of rows

Hi Tom,

Tom Ogilvy schrieb:
Using Resize might be clearer in terms of intent. Just offered for
consideration.

Range("A2").Resize(Range("B1").Value ,1).Value = Range("A1").Value


thus it goes naturally also :-)

--
Mit freundlichen Grüssen

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

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 specific rows to different work sheets Joy New Users to Excel 3 April 7th 10 02:17 PM
Copy / paste only specific rows Benjamin Excel Discussion (Misc queries) 3 April 11th 08 03:14 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
INserting Specific Number of Rows via macro [email protected] Links and Linking in Excel 1 November 14th 06 09:56 PM
COPY AND PASTE SPECIFIC ROWS HERNAN Excel Discussion (Misc queries) 2 August 17th 06 07:32 PM


All times are GMT +1. The time now is 04:21 AM.

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"