Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enter Formula in a cell with VBA
Ok, I've found a new thing that I could do inside QPW
macros that I don't know how to do inside of Excel VBA. I am open to accomplishing this however is necessary in Excel. But I just wanted to describe what actually needs to be taking place. In summary I am putting in a formula while in Cell B1 (see below) that is based on data in Cell D1, and copying that formula down to however many rows in Column B are necessary to match up with what is in column D. Then once I copy the formula far enough down in column B, I need to paste the values that resulted from that formula in those rows in column B. Then after that the column D will no longer be necessary, and it will be deleted. My formula that I want to put in and then copy is as shown below: Range("B1").Select =IF(LEN(D1)=3,+"20"&RIGHT(D1,2)&"0"&LEFT(D1,1),IF( LEN(D1) =4,+"20"&RIGHT(D1,2)&LEFT(D1,2))) Once I learn this technique here, then I should be off to the races again for a while I hope. Bruce |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to enter a formula in a cell? | Excel Worksheet Functions | |||
Can you calculate a formula in the same cell where you enter the d | Excel Discussion (Misc queries) | |||
how to use a cell to enter a filename in a formula | Excel Worksheet Functions | |||
Cannot enter formula in a cell after removing a circular formula | Excel Worksheet Functions | |||
how to enter a null cell value in a formula | Excel Worksheet Functions |