Public Sub uddragFraParentes() Const fraCelle = "A1" 'kan justeres Const tilCelle = "B1" '-"- Dim p, nettoIndhold As String p = InStr(Range(fraCelle), "(")
If p > 0 Then nettoIndhold = Replace(Mid(Range(fraCelle), p + 1), ")", "") Range(tilCelle) = nettoIndhold End If End Sub
Rem Version2 Public Sub uddragFraParentes() Const fraKol = "A" 'kan justeres Const tilKol = "B" '-"- Dim p, nettoIndhold As String, antalRækker As Long, ræk As Long antalRækker = ActiveCell.SpecialCells(xlLastCell).Row
For ræk = 1 To antalRækker p = InStr(Range(fraKol & CStr(ræk)), "(")
If p > 0 Then nettoIndhold = Replace(Mid(Range(fraKol & CStr(ræk)), p + 1), ")", "") Range(tilKol & CStr(ræk)) = nettoIndhold End If Next ræk End Sub
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.