qual é o erro no código abaixo que me faz desaparecer a inputbox; indica que tenho que indicar um valor (independentemente de o tem colocado na inputbox) e não me regista o valor na célula j1?
cÓdigo:
————————————————-
on error resume next
dim therange as range
dim rng
set therange = application.inputbox(prompt:=”indique o valor da multa”, type:=1)
if therange is nothing then
msgbox “tem que indicar um valor!” _
, vbexclamation, title:=”alerta pm consulting®:”
end if
therange.activate
therange.value = rng
range(“j1″).value = rng
””””””””””””””””””””””””””””””””””””””””
certíssimo jorge,
compreendi a diferença! É que o código que estava a utilizar era a adaptação de um outro tipo de inputbox para se selecionar uma célula (daí o range…). neste caso queremos é registar um valor numérico..
funciona, obviamente.
bfs
p.mónica
Autor
Artigos
A visualizar 2 respostas da conversa
Tem de iniciar sessão para responder a este tópico.
Sahifa Theme License is not validated, Go to the theme options page to validate the license, You need a single license for each domain name.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.