Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I am new to excel programming, can you help please?

HI, I am new to excel and this group so treat me kindly :-)

I want to add some VB code to transfer the cell location on one sheet to
another.

That is on sheet1 in cell A1 via VB code I want to insert in that cell
"=sheet2!c3" so that A1 is always the value of sheet2!c2.

I am using a ListBox to get a value of a list and put it in 'Reff'.

The list in sheet 'Constants' is range A3 to A10, so a 3 in Reff points to
Constants!A5.

In 'Selection.Cells(1).Offset(0, 1)' I want to end up with "=Constants!A5".
How do I get there from here?

Thanks for any help you can give me.

Also can you reccomend a good book (no, not Harry Potter....)

---------------code snip --------------------

Range("Reff") = lstSelection.ListIndex
Selection.Cells(1) = lstSelection.Text 'this works fine
Selection.Cells(1).Offset(0, 1) = 'what do I put here???
---------------------end snip



Cheers
Brian
___________________________________
Expressive Systems.
www.expressivesystems.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default I am new to excel programming, can you help please?

Brian,

Try something like

Worksheets("Sheet2").Range("C3").Value = _
Worksheets("Sheet1").Range("C1").Value


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





"Brian" wrote in message
. com...
HI, I am new to excel and this group so treat me kindly :-)

I want to add some VB code to transfer the cell location on one
sheet to
another.

That is on sheet1 in cell A1 via VB code I want to insert in
that cell
"=sheet2!c3" so that A1 is always the value of sheet2!c2.

I am using a ListBox to get a value of a list and put it in
'Reff'.

The list in sheet 'Constants' is range A3 to A10, so a 3 in
Reff points to
Constants!A5.

In 'Selection.Cells(1).Offset(0, 1)' I want to end up with
"=Constants!A5".
How do I get there from here?

Thanks for any help you can give me.

Also can you reccomend a good book (no, not Harry Potter....)

---------------code snip --------------------

Range("Reff") = lstSelection.ListIndex
Selection.Cells(1) = lstSelection.Text 'this works fine
Selection.Cells(1).Offset(0, 1) = 'what do I put
here???
---------------------end snip



Cheers
Brian
___________________________________
Expressive Systems.
www.expressivesystems.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default I am new to excel programming, can you help please?

Hi Brian,

Following should do the job :
Worksheets("Sheet1").Range("A1").Formula = "=Sheet2!C2"

HTH
Cheers
Carim

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
Excel Programming danjordan2000 Excel Discussion (Misc queries) 1 November 17th 08 01:20 PM
Excel Vba Programming kamakshi[_3_] Excel Programming 1 October 1st 05 04:01 PM
Excel programming Jenny G. Excel Programming 5 April 6th 05 02:24 PM
ADO programming and Excel Mark \(InWales\)[_26_] Excel Programming 2 March 15th 05 09:32 PM
how to programming Excel in C# Weimin Zhang Excel Programming 0 October 6th 03 03:29 PM


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

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"