Excel 2003 cellformat efter makrokörning

L

Lars-Erik

Vid manuell konvertering av 1.5 till 1,5 med hjälp av sök/ersätt erhåller
cellen talformat och kan användas i kalkyler.
Om jag spelar in ett makro på samma sätt och därefter kör det, då får cellen
ett textformat och kan ej anvädas i kalkyler.

Hur skall jag göra för att makrot skall fungera lika som manuellt?

Hälsningar
Lars-Erik
 
P

Peo Sjoblom

Du kan lägga till detta

For Each cell In Selection.Cells.SpecialCells(xlConstants, xlTextValues)
cell.Value = CDbl(cell.Value)
Next cell

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey
 
L

Lars-Erik

Det är inspelat med makroinspelaren, dvs samma knapptryckningar som vid
manuell körning.

Sub komma()
'
' komma Makro
' Makrot inspelat 2006-05-11 av anla03
'

'
Cells.Replace What:=".", Replacement:=",", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False
End Sub


"Peo Sjoblom" skrev:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Utkastvy - Normalvy 4
Brevmall 3
Makroprogramering 0
Splittrad wordtabell till Excel 0
E-mail 1
spara 0
Registerprincipinställningen? 3
Formatering av cell 0

Top