Frage

I'm trying to run a Makro which should use the selected cell as Range.

Instead of Range("B1") it should be something like Range("selectedCell")

My code is like this, and I would like the makro to split the data in the selected cell.

Sub tst()
Dim X As Variant
X = Split(Range("B11").Value, ",")
Range("B11").Resize(UBound(X) - LBound(X) + 1).Value = Application.Transpose(X)
End Sub
War es hilfreich?

Lösung

Instead of Range("B11").Value, you can use Selection.Value.

Selection can be more than 1 cell, so you should probably check for that first.

Andere Tipps

  range(selection.address)

keep it simple :)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top