Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Shift+Del buffer

Hi All:

Is there any way to capture what has been placed in the Shift+Del buffer?
I'd like to create a Macro to do the following:
-Edit a cell (F2)
-Select a range of text in the cell (highlighted text)
-Run this macro:
--which asks for text to replace the selected text
--stores the "find" and the "replace" strings to a file
I was able to do this for Word (code below), but what gets me is how to
assign a Selection to copy in Excel - the simplest thing I've thought of was
to use the Shift+Del / Shift+Insert buffer - is this possible?
TIA, JS

==============================================
Sub AltQMacro5()
Dim Twhat As String, Twith As String
Twhat = Selection.Text: Twith = InputBox("Enter text to replace SELECTED
text", , Twhat, 0, 0)
Selection.Find.ClearFormatting:
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = Twhat: .Replacement.Text = Twith
.Forward = True: .Wrap = wdFindContinue
.Format = False: .MatchCase = True: .MatchWholeWord = True
.MatchKashida = False: .MatchDiacritics = False: .MatchAlefHamza =
False
.MatchControl = False: .MatchByte = False: .CorrectHangulEndings =
False
.MatchWildcards = False: .MatchSoundsLike = False:
..MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Open "C:\MacroALQ.txt" For Append Access Write As #1
Print #1, Twhat & "¡" & Twith & "¡" & Format(Date, "yyyy-mm-dd") & "¡" &
Format(Time, "hh:mm:ss") & "¡" & ActiveDocument.Name
Close #1
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Buffer Overflow in Excel Farrah[_2_] Excel Worksheet Functions 1 December 2nd 08 05:17 AM
Clearing the keyboard buffer [email protected] Excel Discussion (Misc queries) 0 February 22nd 07 11:18 AM
Reading txt file into the buffer WannaBeExceller Excel Programming 2 February 8th 06 11:21 PM
buffer overflow Jeff Sward Excel Programming 0 January 7th 04 07:46 PM
Emptying the copy buffer justin Excel Programming 1 October 27th 03 03:03 PM


All times are GMT +1. The time now is 01:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"