![]() |
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. |
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. |
All times are GMT +1. The time now is 04:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com