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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy and Replace

Status
Not open for further replies.

komark

Technical User
Sep 12, 2005
134
US
Hi,
I need to copy a cell and paste it on the other. I need to write a vba code for that.
Can anyone help?
 

komark,

Turn on your macro recorder and have at it.

Post back with your code if you need help cleaning it up and generalizing it.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Skip,
THank you for your help.
How do I compare two cells. Suppose I have two cells C1 and C2. If C1 not equals C2, I want to put out a warning message.

Your help is greatly appreciated.
 
If [C1] <> [C2] Then MsgBox "C1 not equals C2"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Conditional Formatting could change the colour of the background or foreground to highlight the issue. Or you could conditional format a third cell containing the error message. Text colour white unless condition met.

Or use an if statement in VBA (If Range("a1").value<>range("a2").value....to display a message box

Thanks,

Gavin
 
Thank you all for your help.
I am able to get the code running
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top