Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cell in sht2 = cell in sheet 1

Status
Not open for further replies.

brh01

Technical User
Feb 23, 2003
103
I,m trtying to make cell "L1" of sheet1, copy to cell "N1" on sheet 2, using this info

Sub test()
Set srcSht = Sheets("Sheet1")
Set tgtSht = Sheets("Sheet2")
'will copy A1 to A1
tgtSht.[n1] = srcSht.[l1]
End Sub

but it,s not working. Can anyone tell me what I'm doing wrong

Brian
 
Hi brh01,

It should work. Where is it, and how are you running it? Do you get an error message, or does it simply not work? If the latter, are you sure it's running?

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Hi all and thanks. the problem is it only works when I maually run the macro. how and where would I include code to automate this?

Brian
 
The info that's in the cell comes from a calendar control.when the date loads in the cell, I'd like it to trigger the code

Brian
 
You can use the Worksheet_Change event to fire the code. Right click the sheet tab to activate the VB Code window for that sheet object. Select the drop-down in the upper left to select Worksheet and select Change in the drop=down in the upper right.

:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
but what do i write to fire it? I,m not very good at this



Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top