Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Take value from active cell to make formula
What I sent does that without hitting the button...
-- Don Guillett Microsoft MVP Excel SalesAid Software "Sjaakve" wrote in message ... Thanks for all the efforts, I was thinking about something like this. 1 - type "4" in to a cell, can be any cell. 2 - hit a button, or a keystroke 3 - "4" changes into "=OFFSET(MAT!A1;4,1)" , where the 4 in the formule is the 4 i've typed before starting the macro. Is this possible? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Take value from active cell to make formula
Ok, it took me while to figure out how the sent macro works. Thans
again. I got it to work. It works ok, but i wanted it to work with a button. I have to change numbers in that sheet all the time. The restriction would be to large for the macro the save time. like this: 1 - type "4" in to a cell, can be any cell. 2 - hit a button, or a keystroke 3 - "4" changes into "=OFFSET(MAT!A1;4,1)" , where the 4 in the formule is the 4 i've typed before starting the macro. i've tried to rewrite your macro but i can't get it to work. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Take value from active cell to make formula
Sub changefrombutton()
ActiveCell.Formula = "=offset(a1," & ActiveCell & ",2)" End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Sjaakve" wrote in message ... Ok, it took me while to figure out how the sent macro works. Thans again. I got it to work. It works ok, but i wanted it to work with a button. I have to change numbers in that sheet all the time. The restriction would be to large for the macro the save time. like this: 1 - type "4" in to a cell, can be any cell. 2 - hit a button, or a keystroke 3 - "4" changes into "=OFFSET(MAT!A1;4,1)" , where the 4 in the formule is the 4 i've typed before starting the macro. i've tried to rewrite your macro but i can't get it to work. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Take value from active cell to make formula
works beautifully,
thanx. I made some changes of my own. Took me all day to do that. posted below. Sub Lan() Dim offset As Integer For Each c In Selection c.Select ActiveCell.Select If IsNumeric(ActiveCell.Value) Then offset = ActiveCell.Value ActiveCell = "=PROPER(OFFSET(LAN!A1," & offset & ",B1))" With Selection.Interior .Color = 5296274 End With End If Next c End Sub Now the macro work when multiple cells are selected, and when selected cells are merged. Hope you like it. grts, Sjaak |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
make cell active in beginning of macro | Excel Programming | |||
Make the next cell active | Excel Programming | |||
find text in a cell and make cell 2 cells below that active | Excel Programming | |||
How to make a particula cell ACTIVE using C# | Excel Programming | |||
Make a particular cell the active one | Excel Programming |