Solved offet by the number in a cell and insert string

May 4, 2012 at 19:05:13
Specs: Windows 7
Hi, I would like to create a formula that takes the value in the A column and offset by this number of columns to the right and insert a string, say "here". (later i will refference different strings)
for example:
A1 ..... F1
5 ..... "here".
I am trying to combine the offset and fill but going in circles getting nowhere

See More: offet by the number in a cell and insert string

Report •

May 4, 2012 at 19:58:22
✔ Best Answer
Without a macro, the only way I can think to do it is with a bunch of IF statements.

Put this in B1 and drag it across Row 1 as far as you need:


A formula in a cell can not place a value into another cell. It can only evaluate itself and display a value in the cell in which it resides.

However, a macro could read the value in a given cell and use that to determine some other cell to do something to.


Sub HereGoesHere()
   Range("A1").Offset(0, Range("A1")) = "Here"
End Sub


Sub HereGoesHereToo()
   Cells(1, Range("A1") + 1) = "Here"
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question