Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm using a macro calls the find dialog and pastes a value into the 'find
what:' field. The problem I am having is there is a null space at the end of the pasted string (can't find string with the extra space) and I have to manually hit End and Backspace then enter. Can anyone suggest some code that I can insert into the macro to automate these keystrokes? Code below. Thanks, Dan Sub testme() ' code to open find dialog and paste clipboard contents as MyStr Dim MyData As DataObject Dim myStr As String Set MyData = New DataObject myStr = "" On Error Resume Next MyData.GetFromClipboard myStr = MyData.GetText(1) On Error GoTo 0 Application.Dialogs(xlDialogFormulaFind).Show arg1:=myStr Selection.Copy Sheets("Trip Detail").Select Application.Goto Reference:="R1C1" ActiveSheet.Paste ActiveSheet.Paste ActiveSheet.Paste ActiveSheet.Paste ActiveCell.Offset(0, -8).Range("A1:I1").Select ActiveCell.Activate Application.CutCopyMode = False Selection.Copy Sheets("Sheet1").Select ActiveSheet.Paste ActiveCell.Offset(1, 0).Range("A1").Select Sheets("Trip Listing").Select Application.Dialogs(xlDialogFormulaFind).Show arg1:=myStr End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete the "Insert Function Dialog Box" (dialog box only)? | Excel Worksheet Functions | |||
Scroll Bar missing "Control" tab in "Format Properties" dialog box | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Remove content of last visited pages in "Insert Hyperlink" dialog | Excel Worksheet Functions | |||
Replace dialog should put focus on "Find What" not "Replace With" | Excel Discussion (Misc queries) |