#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default VBA

Can someone tell me what do i declare as a variant? i have a code to pupolate
data from one workbook in to the second. i have like 10 columns in my
workbook 2 and like 25 columns in workbook 1. i am trying to get the data for
the 10 columns in workbook 2 from the same cells in workbook 1. i got this
code off the internet but i dunno how to declare variants and ranges...can
someone help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
dtb dtb is offline
external usenet poster
 
Posts: 3
Default VBA

You should avoid variants and you don't need them here. I'm not sure why you
need a VBA macro to do this but the following code will work. Just replace
the range reference to whatever you need it to be. This copies the data from
the first 10 rows and columns in sheet1 to the first 10 rows and columns in
sheet2.

ActiveWorkbook.Worksheets(1).Range("A1:J10").Copy _
ActiveWorkbook.Worksheets(2).Range("A1:J10")


"nick" wrote:

Can someone tell me what do i declare as a variant? i have a code to pupolate
data from one workbook in to the second. i have like 10 columns in my
workbook 2 and like 25 columns in workbook 1. i am trying to get the data for
the 10 columns in workbook 2 from the same cells in workbook 1. i got this
code off the internet but i dunno how to declare variants and ranges...can
someone 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



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