LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 71
Default macro code question

Hi guys,

I know this is a MAC forum and I am on excel 2003 but I thought maybe
someone can help...

I have a button that when you click on it, it makes cell A1 duplicate what
is in cell A2. But I need to have clicked on A1 before I press the button
for it to work. For example if I happen to be on cell D4 and click the
button, then a 0 goes in the D4 cell and nothing happens in the A1, it does
not not duplicate whats in A2.

I would like the D4 cell to be ignored and just have the button coded to
where when I click it, regardless of where my cursor is, the A1 cell will
duplicate what is in A2.

I hope it is a simple line or command that I can put in the code. Thanks to
anyone who can help! -maria

Here is the code I have for the button now:

Private Sub CommandButton1_Click()
ActiveCell.FormulaR1C1 = ""
ActiveCell.FormulaR1C1 = "=R[1]C"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub

 
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
code question Shu of AZ Excel Discussion (Misc queries) 2 July 12th 08 01:10 AM
vb code question Stan Excel Discussion (Misc queries) 8 April 25th 08 10:43 PM
A macro code question from a novice Richard Excel Discussion (Misc queries) 2 December 24th 07 07:22 PM
Another code question M&M[_2_] Excel Discussion (Misc queries) 3 August 9th 07 10:00 PM
VBA code question JEV Excel Discussion (Misc queries) 2 March 1st 07 06:02 PM


All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"