Re: Column Select Mode

From: Mike Petrie (mike_at_petrie.u-net.com)
Date: 05/07/04


Date: Fri, 7 May 2004 11:47:23 +0100

Thanks Doug & Klaus,

Two variations to play with. I'll have a go at getting this working over the
weekend - back again after that.

Thanks
Mike

"Klaus Linke" <info@fotosatz-kaufmann.de.no.junk> wrote in message
news:u9DipV8MEHA.3420@TK2MSFTNGP11.phx.gbl...
> Hi Mike,
>
> I ran into that bug too.
>
> Running a macro always turns off the column select mode.
> And if you turn on the column select mode in a macro, it gets turned off
> again when the macro finishes.
>
> There doesn't seem to be anything you can do about it :-(
>
> If you have selected some block in your macro, and your macro has stopped,
> the user will have to use Ctrl+Shift+F8 again to turn the mode on again,
> and to make changes to the selected block.
>
> If you have some start and end points (rng.Start, rng.End, given by the
> current Selection in the macro below) and want to select the "block", you
> could use something like
> Dim rng As Range
> Dim iStartLine As Long
> Dim iEndLine As Long
> Dim iStartCol As Long
> Dim iEndCol As Long
> Set rng = Selection.Range.Duplicate
> iStartLine = rng.Information(wdFirstCharacterLineNumber)
> iStartCol = rng.Information(wdFirstCharacterColumnNumber)
> Selection.Collapse (wdCollapseEnd)
> iEndLine = Selection.Information(wdFirstCharacterLineNumber)
> iEndCol = Selection.Information(wdFirstCharacterColumnNumber)
> rng.Select
> Selection.Collapse (wdCollapseStart)
> Selection.ColumnSelectMode = True
> Selection.MoveLeft Unit:=wdCharacter, Count:=iStartCol
> Selection.MoveDown Unit:=wdLine, Count:=(iEndLine - iStartLine)
> Selection.MoveRight Unit:=wdCharacter, Count:=iEndCol - 1
>
> As said above, the user would have to click Ctrl+Shift+F8 again to change
> the block.
>
> Regards,
> Klaus
>
>
> "Mike Petrie" <mike@petrie.u-net.com> wrote:
> > I'm trying to get a column select mode type effect. I can use
> CTRL+SHIFT+F8
> > and the cursor keys or mouse to get a selection and copy that to the
> > clipboard, for instance. However, if I create a macro to turn the mode
on
> > and then leave the user to mouse around it doesn't work - the mode is
> > deselected (or never gets selected?) I used the code from the Macro
> Recorder
> > as a basis - it looks like this:
> >
> > Sub ColSelMode()
> > '
> > If Selection.ColumnSelectMode = False Then
> > Selection.ColumnSelectMode = True
> > Else
> > Selection.ColumnSelectMode = False
> > Selection.End = Selection.Start
> > End If
> >
> > End Sub
> >
> > If I have some cursor navigation commands following the End If, it's
> fine!
> > Any ideas?
> >
> >
> > The second and related problem is that I use a couple of bookmarks to
> > delimit a range in the document. This is fine for a normal selection,
but
> > I'd like to be able to use the same two markers to delimit the NE/SW
> corners
> > of a column selection block. Unfortunately the colomn select mode
doesn't
> > support ranges (or should that be the other way around), and also,
> > navigation seems to be limited to cursor up/down a line and L/R a
> character,
> > you don't seem to be able to jump to a point. I'd like to be able to go
> to
> > the first bookmark, turn on column mode, jump to the second one, and
then
> > run any of a series of other commands based on what the user has typed -
> > copy, paste, move, delete, write to file, etc. Does anyone know of a
work
> > around for such a scenario.
> >
> >
> > Thanks!
> > Mike
> >
> >
>
>



Relevant Pages

  • Re: Moving to next field with F11 in protected document
    ... macro is invoked with a keyboard hotkey and looks at the characters to ... a file with the name of the selection and inserts one space and then ... Dim rgeField As Range ... Dim lngStart As Long ...
    (microsoft.public.word.vba.beginners)
  • Re: Help end the testing tedium please
    ... Dim strFilter As String ... the consolidate button uses this macro (which may be a nightmare to ... With Selection ...
    (microsoft.public.excel.programming)
  • Re: How do I write a Visio macro operating on a selection?
    ... you need to translate the macro code into something ... using a reference to the selection. ... Dim UndoScopeID1 As Long ... visRowLine, visLineWeight).FormulaU = "0.25 mm" ...
    (microsoft.public.visio.developer)
  • Re: Transposing data in columns into a single row?
    ... Simply select the range of data from a column and kick off the macro and that data will be moved to consecutive columns. ... If your data selection is something other than a single column, you will be warned with a MessageBox. ... Dim StartRow As Long ... Dim StartCol As Long ...
    (microsoft.public.excel)
  • Re: Open File within a macro
    ... Record a macro when you parse your input file. ... Dim DesktopPath As String ... the code to run the Open file dialogue pointing to any desktop, ... allow the user to make a selection which would then import the text file ...
    (microsoft.public.excel.misc)

Loading