Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
programmernovice wrote:
Say I have the number "2" in cell A1 of sheet "Assets". Can someone please provide a simple vba command for: 1. Entering the contents of cell A1 into cell A5 of "Assets" Sheets("Assets").Range("A5").Value = Sheets("Assets").Range("A1").Value 2. Entering the contents of cell A1 of "Assets" into cell A5 of sheet "Liabilities". Sheets("Liabilities").Range("A5").Value = Sheets("Assets").Range("A1").Value (In VBA, an underscore ("_") by itself at the end of a line is a line- continuation character.) In the old (pre-Vba Excel) macro language which I am familiar with the command "Formula" was used, however, it does not appear to available in VBA. In VBA, the .Formula property refers to, somewhat obviously, the formula, while the .Value property refers to the displayed value. So, if A1 has a formula of =1+1, then Cells(1, 1).Value = 2 Cells(1, 1).Formula = "=1+1" (Cells(1, 1) is how you refer to cells in R1C1 format. Range("A1") is of course the other way. R1C1 is easier for me since I do a lot of looping through every cell in a given column/row/sheet.) I greatly appreciate all help. It might be worth reading through a beginner's introduction the VBA. Googling that phrase should be useful. Wikibooks has a few, but the ones I looked at don't seem to be for beginners. -- Power attracts the corruptible. Suspect all who seek it. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to check if the cell contains number 1 by moving down thecolumns? | Excel Programming | |||
Moving custom number format to NUMBER | Setting up and Configuration of Excel | |||
moving cells to another column based on number of characters | Excel Programming | |||
Moving Cursor once set number of characters are entered. | Excel Programming | |||
Moving a variable number of Sheets to another Workbook | Excel Programming |