![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Essex, England
Posts: 458
|
I'm checking a long text file and extracting odd bits of information to use in another sheet. This involves a lot of copy/pasting and switching between sheets.
Is it possible to address a cell in a sheet that is not the active one? Something like Sheet1.Cells(myCount1,1)=Sheet2.Cells(myCount2,1) Thanks in advance GaryB |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
Sheets(1).Cells(mycount1, 1).Copy _ Destination:=Sheets(2).Cells(mycount2, 1) This will copy A1 in the first worksheet to B1 in the second worksheet. (assumes mycount1=1 and mycount2=2) Am I on the right track? _________________ Barrie Davidson My Excel Web Page [ This Message was edited by: Barrie Davidson on 2002-03-11 18:25 ] [ This Message was edited by: Barrie Davidson on 2002-03-11 18:26 ] |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Essex, England
Posts: 458
|
Barrie,
Spot on! It actually copies it into A2 not B1, but as it's exactly what I was after, I'll let you off! Many Thanks GaryB |
|
|
|
|
|
#4 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Gary
If you need the info from another Open Workbook you can use: Workbooks("Book2.xls").Sheets("Sheet1").Range("A10:A20").Copy _ Destination:=Sheet2.Range("A1") |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: Essex, England
Posts: 458
|
Thanks for that. I'll bear it in mind for the future.
Cheers GaryB |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|