ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using variables to select multiple rows using a macro (https://www.excelbanter.com/excel-programming/374482-using-variables-select-multiple-rows-using-macro.html)

chad

using variables to select multiple rows using a macro
 
I am trying to use 2 different variables and either the ROWS or RANGE command
in a macro to select a continuous block of rows. I want to copy this block
from one sheet to another sheet. I have been trying to use the following
syntax with no avail: ROWS(firstrownumber,lastrownumber).Select I also
tried using:
RANGE(firstrownumber:firstrownumber,lastrownumber: lastrownumber).Select I
have to use a variable, because the actual row numbers I will be copying and
pasting will change every time I run the macro. I can make it work if I only
select and copy one row at a time, but in one of my sheets I need to select
and copy 2880 rows of data, and doing that one at a time takes about 5
minutes. Any suggestions would be very much appreciated. Thanks.


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com