Newbie help please

  • Thread starter Thread starter John Taylor-Johnston
  • Start date Start date
J

John Taylor-Johnston

Hi,
I'm new at this. I would like to pause this and enter the content for Name:=""

as in Name:="Albion2"

How can I re-write this please?

John

Sub f12()
'
' f12 Macro
' Macro recorded 15/11/04 by jtjohnston
'
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="Albion2"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
End Sub
 
John,

This is an Access newsgroup, though your macro is abviously an Excel one,
and should have been posted accordingly. Anyway, the answer is:

Sub f12()
'
' f12 Macro
' Macro recorded 15/11/04 by jtjohnston
'
rng = InputBox "Please enter a range name"

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:= rng
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
End Sub

Nikos
 
Nikos,
Thank you for your reply. Actually it was a Word question. I did not see a newgroup for Word, although bookmarks work in Access too :)
But THANK YOU for your help. However, it does not work.

rng = InputBox "Please enter a range name"

I'm using word 97 (I know it's shameful) and it invokes the Save-As window.

Ideas?

John
 
Nikos,
Anyone,
What I would really like to do is pause in the bookmark window and enter my own data.
It applies to access or word macros.
John
Nikos,
Thank you for your reply. Actually it was a Word question. I did not see a newgroup for Word, although bookmarks work in Access too :)
But THANK YOU for your help. However, it does not work.

rng = InputBox "Please enter a range name"

I'm using word 97 (I know it's shameful) and it invokes the Save-As window.

Ideas?

John

--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law."

''' Collège de Sherbrooke:
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- 819-569-2064

°v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures
/(_)\ Université de Sherbrooke
^ ^ http://compcanlit.ca/ T: 819.569.2064
 
Actually,
I get a compile error in Microsoft Visual basic
Compile error: Syntax Error
on this line:
rng = InputBox "Please enter a range name"
John

Nikos said:
John,

This is an Access newsgroup, though your macro is abviously an Excel one,
and should have been posted accordingly. Anyway, the answer is:

Sub f12()
'
' f12 Macro
' Macro recorded 15/11/04 by jtjohnston
'
rng = InputBox "Please enter a range name"

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:= rng
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
End Sub

Nikos

--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law."

''' Collège de Sherbrooke:
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- 819-569-2064

°v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures
/(_)\ Université de Sherbrooke
^ ^ http://compcanlit.ca/ T: 819.569.2064
 
John,

Obviously a Word thing, I must have been blind. I must onfess I'm clueless
when it comes to Word VBA, but a simple F1 on inputbox while in Word VB
editor solved the mystery. The syntax is:

rng = InputBox("Please enter a range name")

Just add the brackets around the prompt and you're there!

HTH,
Nikos
 
Back
Top