index > Visual Basic for Applications (VBA) > How to pass a value of a clicked cell to another cell in a differ...

How to pass a value of a clicked cell to another cell in a differ...


Guys,

How to pass a value of a clicked cell to another cell in a different worksheet?

Thank you!




Alexander
Alexander72

Hello Alexander,

You need to eloborate on what you are trying to do to get a proper response.

You could try the worksheet_Change event, and then use the properties of the active cell but without knowing what you want to achieve and when to achieve it, it is difficult to answer

Chas

ChasAA

Use this in the module, it will pass the "formula" for clicked cell to sheet2 at A1. Use ActiveCell.Value if you want to value instead. You have to triger this macro by hand. About pass the value to a diffrent cell, just be creative.

sub PassData()

Sheets("sheet2").Range("A1").FormulaC1R1 = ActiveCell.FormulaC1R1

end sub

magicalclick

Hi Guys:

I work it out. It is very simple. one line of code is enough

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet2.Cells(2, 2) = Sheet1.Cells(Target.Row, Target.Column)
End Sub

simply copy the sub to the sheet you want to click and change the receiving sheet number and cell address.




Chris Hou
Chris Hou
reply 4

You can use google to search for other answers

 

More Articles

• How to protect VBA code inside Excel?
• Setting Chart Title through VBA sometimes works sometimes doesn't...
• dbclick listbox additem
• VBA for Powerpoint
• How do you test a user's input for alphabets?
• Excel - squares appear when sending info from textbox to cell
• Check the feasibility to program with the PowerPoint's presenter'...
• Copying selected Worksheets to new workbook
• Visio Zoom
• Deleting tabs when a cell is emptied
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

• VB6 XP Themes support. Solved! Source in
• select rows
• Administration tool
• Variable for TextBox Objects
• Glass effect in vb.net whitout dwmapi.dl
• How to protect VBA code inside Excel?
• hyperlink --> image needed in Word or
• Excel edit mode
• Getting the formatted cell value
• Data Access Pages - FAO Chas
• Crying like a baby
• Excel ShapesText
• VBA Excel/Oracle query and run-time erro
• Help with a formula
• Select query returns non-existing data

Hot Articles

• VBA Help File throws Internet Explorer S
• Customized Scheduler in Outlook 2003 Cal
• Passing new parameters to rdlc reports
• getting web pages from VBA?
• empty datagrid
• Date validation on a form
• How do I reference changes to be made in
• ComboBox itemData as Long => error
• How do I avoid multiple instances of Excel
• Search all text objects - PowerPoint VBA
• VBA excel - problem with having clause i
• Need help with VBA project, need it to t
• Needing Transform XML in Excel
• is weekday
• Lost... Face on a milk bottle lost

Recommend Articles

• Adding an Outlook Feature
• I need help figuring out what is crashin
• Multithreading, Callback & VBA in Po
• % comleted box
• Refreshing a web query that is behind a
• No Database Type
• How to dial a modem and pass a .wav file
• Property to evaluate heading value of Ac
• show vba application
• Access Security Warnings
• Serial Port communication from Excel 2003
• Autofilter criteria's
• help on list box (Access)
• Help with DDEExecute
• Preventing keyboard shortcuts