How to write a function or macro to copy

R

rpd

Please help...

I need to know how to write a function or macro to copy the contents of
cell (A) to cell (C) and contents of a cell (B)to the comments of cell
(C). Additionally I need to execute this accross several sheets in a
workbook, how would I do that?


i.e. A1 copied to C1; B1 copied to the comments of C1 or
Worksheet1.A1 copied to Worksheet2.C5; Worksheet1.B2 copied to comments
of Worksheet2.c5.

Thanks for your help
 
P

PY & Associates

change cells(1,3) to sheets(1).cells(1,3) and the like.

From: "RandEman" <[email protected]>
Subject: RE: How to write a function or macro to copy
Date: Saturday, September 03, 2005 1:31 AM

One more question, I need to run this accross several sheets in a workbook,
how would I do that?

Gary's Student said:
Try this:

Sub temp()
Cells(1, 3).Value = Cells(1, 1).Value
Cells(1, 3).AddComment
Cells(1, 3).Comment.Text Text:=Cells(1, 2).Value
End Sub

Its pretty neat. You can insert or modify all cells in a range with this
kind of technique

Have a good day!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top