Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Is there a VBA technique €“ direct or indirect €“ to read chunks of cells rather than copying. The following reads b4 to both a1 and a4. Range("a1,a4").Value = Range("b4,b1").Value If there is none is there a technique to do copying without selecting or activating copied or receiving area. Can someone help? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why don't you want to use COPY. You DON'T need to select or activate cells
to use copy. You must be using the Macro Recorder code as your examples. I always modify the Recorded macros to remove the activate and selection. for example Workbooks("book1.xls").Sheets("Sheet1").Range("A1: D4").Copy _ Destination:=Workbooks("book2.xls").Sheets("Sheet1 ").Range("A1") or With Workbooks("book1.xls").Sheets("Sheet1") .Range("A1:D4").Copy _ Destination:=Workbooks("book2.xls").Sheets("Sheet1 ").Range("A1") end With or Set DestSht = Workbooks("book2.xls").Sheets("Sheet1") With Workbooks("book1.xls").Sheets("Sheet1") .Range("A1:D4").Copy Destination:=DestSht.Range("A1") end With "Varne" wrote: Hi Is there a VBA technique €“ direct or indirect €“ to read chunks of cells rather than copying. The following reads b4 to both a1 and a4. Range("a1,a4").Value = Range("b4,b1").Value If there is none is there a technique to do copying without selecting or activating copied or receiving area. Can someone help? Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Thanks for the answer. I avoid copying and usually use cell by cell reading but it takes too long if it has to read a lot. Thanks. "Joel" wrote: Why don't you want to use COPY. You DON'T need to select or activate cells to use copy. You must be using the Macro Recorder code as your examples. I always modify the Recorded macros to remove the activate and selection. for example Workbooks("book1.xls").Sheets("Sheet1").Range("A1: D4").Copy _ Destination:=Workbooks("book2.xls").Sheets("Sheet1 ").Range("A1") or With Workbooks("book1.xls").Sheets("Sheet1") .Range("A1:D4").Copy _ Destination:=Workbooks("book2.xls").Sheets("Sheet1 ").Range("A1") end With or Set DestSht = Workbooks("book2.xls").Sheets("Sheet1") With Workbooks("book1.xls").Sheets("Sheet1") .Range("A1:D4").Copy Destination:=DestSht.Range("A1") end With "Varne" wrote: Hi Is there a VBA technique €“ direct or indirect €“ to read chunks of cells rather than copying. The following reads b4 to both a1 and a4. Range("a1,a4").Value = Range("b4,b1").Value If there is none is there a technique to do copying without selecting or activating copied or receiving area. Can someone help? Thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
This is for fellow users; Whilst trying codes shown by Joel I found something. The following confusing codes can be used to copy data to many destinations; Range("j1").Copy Range("j1:j500000") "Varne" wrote: Hi Thanks for the answer. I avoid copying and usually use cell by cell reading but it takes too long if it has to read a lot. Thanks. "Joel" wrote: Why don't you want to use COPY. You DON'T need to select or activate cells to use copy. You must be using the Macro Recorder code as your examples. I always modify the Recorded macros to remove the activate and selection. for example Workbooks("book1.xls").Sheets("Sheet1").Range("A1: D4").Copy _ Destination:=Workbooks("book2.xls").Sheets("Sheet1 ").Range("A1") or With Workbooks("book1.xls").Sheets("Sheet1") .Range("A1:D4").Copy _ Destination:=Workbooks("book2.xls").Sheets("Sheet1 ").Range("A1") end With or Set DestSht = Workbooks("book2.xls").Sheets("Sheet1") With Workbooks("book1.xls").Sheets("Sheet1") .Range("A1:D4").Copy Destination:=DestSht.Range("A1") end With "Varne" wrote: Hi Is there a VBA technique €“ direct or indirect €“ to read chunks of cells rather than copying. The following reads b4 to both a1 and a4. Range("a1,a4").Value = Range("b4,b1").Value If there is none is there a technique to do copying without selecting or activating copied or receiving area. Can someone help? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reading data arrays from multiple data files in excel | Excel Discussion (Misc queries) | |||
Reading data from PPT and purge data to Excel and image | Excel Programming | |||
Reading data from excel | Excel Programming | |||
Reading excel data into another aplication | Excel Programming | |||
Why does this keep blowing chunks | Excel Programming |