In Word, can I copy a number to the clipboard then do maths on it?

J

John

Hi.

I am very new to this.

I'd be really grateful if someone could help/guide me. I want to
create a macro in Microsoft Word but I don't know visual basic.

I want to be able to highlight a number then:

- copy it to the clipboard
- subtract 298
- paste the value to the Word document, overwriting the original text

Thanks
 
Y

Yves Dhondt

There is no need to go through to clipboard, your macro can do it.

Sub ScratchMacro()
Selection.Range.text = Selection.Range.text - 298
End Sub

Yves
 

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

Top