Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2011, 11:47 AM
Johnny thunder Johnny thunder is offline Macro for moving one cell down from current position Windows XP Macro for moving one cell down from current position Office 2003
Novice
Macro for moving one cell down from current position
 
Join Date: Apr 2011
Posts: 10
Johnny thunder is on a distinguished road
Default Macro for moving one cell down from current position

Hello Friends,




I have a macro that is copying the results of one form field to about 15 others and I have entered the macro "On exit" so once the user updates the Drop-Down with his comments "Add" "Delete" I need the macro to say move to the next form field or toggle down.


Any ideas? I usually use something like foundcell.Offset(1, 1) in excel but I am not sure how to get it to work in Word?

Here is my code

Sub LMSI_Office()
Dim StrResult As String, i As Integer
With ActiveDocument
StrResult = .FormFields("LMSI_Office1").Result
For i = 2 To 15
.FormFields("LMSI_Office" & i).Result = StrResult
Next
End With
End Sub
Reply With Quote
  #2  
Old 04-07-2011, 04:25 PM
macropod's Avatar
macropod macropod is offline Macro for moving one cell down from current position Windows 7 32bit Macro for moving one cell down from current position Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Johnny,

As mentioned in your other thread, simply tabbing out of the formfield will take you to the next one. If you click somewhere out of the formfield, Word doesn't know where you want to go next (eg you might want to go back to a previous formfield). So, if one were to build into an 'on exit' macro some code that forced the user to go to the next formfield, the result might be more aggravation than you really want.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-07-2011, 04:31 PM
Johnny thunder Johnny thunder is offline Macro for moving one cell down from current position Windows XP Macro for moving one cell down from current position Office 2003
Novice
Macro for moving one cell down from current position
 
Join Date: Apr 2011
Posts: 10
Johnny thunder is on a distinguished road
Default

Paul,


I don't think the user will mind. I sent a reply on the other thread.
Reply With Quote
  #4  
Old 04-07-2011, 04:44 PM
macropod's Avatar
macropod macropod is offline Macro for moving one cell down from current position Windows 7 32bit Macro for moving one cell down from current position Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, you could use code like:

Code:
Sub LMSI_Office()
Dim StrResult As String, i As Integer
With ActiveDocument
  StrResult = .FormFields("LMSI_Office1").Result
  For i = 2 To 15
    .FormFields("LMSI_Office" & i).Result = StrResult
  Next
  .Bookmarks("BookmarkName").Range.Fields(1).Result.Select
End With
End Sub
where "BookmarkName" is the bookmark name of the formfield you want to go to.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
form field, macro, word 2003



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for moving one cell down from current position Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM
Macro for moving one cell down from current position Moving formula range multiple cells when moving sum over one cell FraserKitchell Excel 4 02-26-2010 10:38 AM
copy cell from sheet 2 to sheet 3 macro slipperyjim Excel Programming 1 02-18-2010 01:31 AM
Macro for moving one cell down from current position Auto insert current month's name and current year Styler001 Word 4 01-25-2010 06:40 PM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft