ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   getting values without using "select" (https://www.excelbanter.com/excel-programming/300063-getting-values-without-using-select.html)

ornit

getting values without using "select"
 
hello all
I have a question:
I'm trying to use values from different worksheets but I don't know ho
to do it without using the "select" command, I don't even know if it'
possible.

Here is an example:

Sheets("january").Select
Range("A12").Select
Selection.copy

Can I get the value without "selecting" it first?

thank

--
Message posted from http://www.ExcelForum.com


Chip Pearson

getting values without using "select"
 
It is almost always unnecessary to Select a range before using
it. For example,

Dim Var As Variant
Var = Worksheets("January").Range("A12").Value
' or
Worksheets("January").Range("A12").Copy


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ornit " wrote in message
...
hello all
I have a question:
I'm trying to use values from different worksheets but I don't

know how
to do it without using the "select" command, I don't even know

if it's
possible.

Here is an example:

Sheets("january").Select
Range("A12").Select
Selection.copy

Can I get the value without "selecting" it first?

thanks


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy

getting values without using "select"
 
Sheets("January").Range("A12").Copy _
Destination:=Sheets("February").Range("M9")

--
Regards,
Tom Ogilvy

"ornit " wrote in message
...
hello all
I have a question:
I'm trying to use values from different worksheets but I don't know how
to do it without using the "select" command, I don't even know if it's
possible.

Here is an example:

Sheets("january").Select
Range("A12").Select
Selection.copy

Can I get the value without "selecting" it first?

thanks


---
Message posted from http://www.ExcelForum.com/




Gord Dibben

getting values without using "select"
 
ornit

Range(Range("A1"), Range("A1").End(xlDown)).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.Paste

is equal to.....

Range(Range("A1"), Range("A1").End(xlDown)).Copy _
Destination:=Sheets("Sheet2").Range("A1")

Instead of......

Dim actSht As Worksheet
Set actSht = ActiveSheet
Worksheets("Sheet2").Activate
Range("A1:J10").Select
Selection.Copy
actSht.Activate
Range("K43").Select
ActiveSheet.Paste

use.......

Worksheets("Sheet2").Range("A1:J10").Copy _
Destination:=ActiveSheet.Range("K43")

or, if you just want to copy values:

Range("K43").Resize(10, 10).Value = _
Worksheets("Sheet2").Range("A1:J10").Value

which bypasses using the Clipboard (and is analogous to Paste
Special/Values)

Gord Dibben Excel MVP

On Tue, 1 Jun 2004 11:07:20 -0500, ornit
wrote:

hello all
I have a question:
I'm trying to use values from different worksheets but I don't know how
to do it without using the "select" command, I don't even know if it's
possible.

Here is an example:

Sheets("january").Select
Range("A12").Select
Selection.copy

Can I get the value without "selecting" it first?

thanks


---
Message posted from http://www.ExcelForum.com/



marijo[_10_]

getting values without using "select"
 
you can try =sheet!A1 (the cell you will use as reference)
or vlookup.

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:48 PM.

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