Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Calling to a specific cell

I can't seem to find a way to place a cell's location in
a variable or how to call a cell from another sheet.
Basically I need a macro running on sheet 2 to call A3 on
sheet1 and report the value stored there. Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Calling to a specific cell

if you want to get anything done in VBA you must
study cell and range referencing.

just asking for a quick answer here wont help.

ALL vba books i ever read contain many pages on the subject.
I woud have plenty of suggestions... except you need to understand
rather then copy it.

Which workbook are we talking about?
the currently active workbook =Activeworkbook
the workbook in which the code is running =Thisworkbook
or a specific workbook =Workbooks("vbaLesson1")

How do you want to refer to the sheets?
Use the currently activesheet =ActiveSheet
Use the first sheet in the workbook =Worksheets(1)
or a specific worksheet =Worksheets("sheet1")

etc

you're question is ambiguous.. so this is what i make of it:

if activesheet.name = "sheet2" then
activecell=[sheet1!a3]
else
msgbox "you're not on sheet2"
endif



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Kura" wrote:

I can't seem to find a way to place a cell's location in
a variable or how to call a cell from another sheet.
Basically I need a macro running on sheet 2 to call A3 on
sheet1 and report the value stored there. Any suggestions?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Calling to a specific cell

Eh... its much more simple than that. Basically I just
need to know how to call up a cell from sheet1 of
WorkBook1 by running a macro on sheet2 of the same
workbook.

PseudoCode run by clicking a command button on sheet2:

dim flagValue as integer
flagValue=Sheet1:a3.value
Sheet2:d12.value=flagValue

That's roughly what I'm trying to do, but I haven't been
able to figure out how to reference the specific cells. I
know how to do most other features and have a rather
extensive background with VB5, but I've never used
anything with cells like this.


-----Original Message-----
if you want to get anything done in VBA you must
study cell and range referencing.

just asking for a quick answer here wont help.

ALL vba books i ever read contain many pages on the

subject.
I woud have plenty of suggestions... except you need to

understand
rather then copy it.

Which workbook are we talking about?
the currently active workbook

=Activeworkbook
the workbook in which the code is running =Thisworkbook
or a specific workbook =Workbooks

("vbaLesson1")

How do you want to refer to the sheets?
Use the currently activesheet =ActiveSheet
Use the first sheet in the workbook =Worksheets

(1)
or a specific worksheet =Worksheets

("sheet1")

etc

you're question is ambiguous.. so this is what i make of

it:

if activesheet.name = "sheet2" then
activecell=[sheet1!a3]
else
msgbox "you're not on sheet2"
endif



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Kura" wrote:

I can't seem to find a way to place a cell's location

in
a variable or how to call a cell from another sheet.
Basically I need a macro running on sheet 2 to call A3

on
sheet1 and report the value stored there. Any

suggestions?


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Calling to a specific cell

Oops, heh, on closer inspection of your post I was able
to extract a few lines of code and now understand how to
reference cells. Thanks for your help!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Calling to a specific cell

good!.. <vbg

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Kura" wrote:

Oops, heh, on closer inspection of your post I was able
to extract a few lines of code and now understand how to
reference cells. Thanks for your help!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Calling to a specific cell

You didn't tell me quite enough. How do you know the
cell's location?? You said "how to call a cell . . .". I
don't understand what you mean by "calling" a cell. Do you
mean, that while you are in one sheet, you want to get the
value of a cell in another sheet?
Suppose you are in sheet A and you want a value from a cell
in sheet B. If you know that the address of the cell in
sheet B is, say, A16, then you can refer to it as:
SheetB!A16.
Another technique is to give the cell in Sheet B a defined
name. To do that, go to sheet B and select cell A16, then
in the little box in the upper left of your window that
shows "A16", type the name that you want to assign to that
cell, then press ENTER. Now if you put your cursor on A16
and look in that box, you should see the name you assigned.
Assumming that worked, now you can refer to Sheet B's A16
by its name without any qualification. On Sheet A where
you might write A16, now write that defined name. Works
like a charm!.
-----Original Message-----
I can't seem to find a way to place a cell's location in
a variable or how to call a cell from another sheet.
Basically I need a macro running on sheet 2 to call A3 on
sheet1 and report the value stored there. Any suggestions?
.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Calling to a specific cell

Form in a standard module:

Sub Test()
Dim flagValue As Integer
flagValue = Worksheets("Sheet1").Range("a3").Value
Worksheets("Sheet2").Range("d12").Value = flagValue
End Sub

HTH

"Kura" wrote in message
...
Eh... its much more simple than that. Basically I just
need to know how to call up a cell from sheet1 of
WorkBook1 by running a macro on sheet2 of the same
workbook.

PseudoCode run by clicking a command button on sheet2:

dim flagValue as integer
flagValue=Sheet1:a3.value
Sheet2:d12.value=flagValue

That's roughly what I'm trying to do, but I haven't been
able to figure out how to reference the specific cells. I
know how to do most other features and have a rather
extensive background with VB5, but I've never used
anything with cells like this.


-----Original Message-----
if you want to get anything done in VBA you must
study cell and range referencing.

just asking for a quick answer here wont help.

ALL vba books i ever read contain many pages on the

subject.
I woud have plenty of suggestions... except you need to

understand
rather then copy it.

Which workbook are we talking about?
the currently active workbook

=Activeworkbook
the workbook in which the code is running =Thisworkbook
or a specific workbook =Workbooks

("vbaLesson1")

How do you want to refer to the sheets?
Use the currently activesheet =ActiveSheet
Use the first sheet in the workbook =Worksheets

(1)
or a specific worksheet =Worksheets

("sheet1")

etc

you're question is ambiguous.. so this is what i make of

it:

if activesheet.name = "sheet2" then
activecell=[sheet1!a3]
else
msgbox "you're not on sheet2"
endif



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Kura" wrote:

I can't seem to find a way to place a cell's location

in
a variable or how to call a cell from another sheet.
Basically I need a macro running on sheet 2 to call A3

on
sheet1 and report the value stored there. Any

suggestions?


.



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a specific worksheet from a hyperlink in a seperate file. TheChris Excel Worksheet Functions 0 February 2nd 06 01:48 AM
Referencing Calling Cell JE McGimpsey Excel Programming 0 March 2nd 04 08:18 PM
Referencing Calling Cell Chip Pearson Excel Programming 0 March 2nd 04 08:16 PM
calling VBA functions from a cell rturner138 Excel Programming 2 January 19th 04 09:11 PM
Calling up a specific Help topic? Ed[_9_] Excel Programming 2 December 18th 03 01:55 PM


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