Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Very very basic macro help
I am trying to learn visual basic through example. Can somone help me solve
this problem? I have two different Excel workbooks, both located on my desktop. The first is named Book1.xls The second is Book2.xls On Sheet 1 of Book1, under column A (cells 2 through 11) I have the numbers 1 through 10. I would like to write a macro that copies the values in these cells and pastes them into sheet 1 of Book2, in the same cells. Also, I would like for the cells in book 2 to be red, and the font to be bold and white. Please help. Thanks. |
#3
|
|||
|
|||
This code was produced by the macro recorder (it's a good way to learn how to
write macros): Sub Macro1() Windows("Book1").Activate Range("A2:A11").Select Selection.Copy Windows("Book2").Activate Range("A2").Select ActiveSheet.Paste With Selection.Interior .ColorIndex = 3 .Pattern = xlSolid End With Selection.Font.ColorIndex = 2 Selection.Font.Bold = True Range("A12").Select End Sub "Mr. Smiley" wrote: I am trying to learn visual basic through example. Can somone help me solve this problem? I have two different Excel workbooks, both located on my desktop. The first is named Book1.xls The second is Book2.xls On Sheet 1 of Book1, under column A (cells 2 through 11) I have the numbers 1 through 10. I would like to write a macro that copies the values in these cells and pastes them into sheet 1 of Book2, in the same cells. Also, I would like for the cells in book 2 to be red, and the font to be bold and white. Please help. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Calling Visual Basic References | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
How do I run a Macro on basic of a value in a specific cell | Excel Worksheet Functions | |||
Date macro | Excel Discussion (Misc queries) | |||
Visual Basic Macro | Excel Discussion (Misc queries) |