Hello Folks,
I have a macro that seeks out and creates a range from a database:
Sub Title_Number_Search()
Dim SearchValue As String
SearchValue = InputBox("Enter Title Code" & Chr(13) & _
"####")
If SearchValue = "" Then
Exit Sub 'user pressed Cancel
Else
Call SelectAll(SearchValue)
End If
End Sub
Sub SelectAll(fWhat As String)
Dim F As Range, U As Range, fAdr As String
With ActiveSheet.UsedRange
Set F = .Find(what:=fWhat & "*", LookIn:=xlValues, lookat:=xlPart)
If Not F Is Nothing Then
fAdr = F.Address
Set U = F
Else
GoTo None
End If
Do
Set F = .FindNext(F)
If F Is Nothing Then Exit Do
If F.Address = fAdr Then Exit Do
Set U = Union(F, U)
Loop
End With
If Not U Is Nothing Then
U.Select
Else
None: MsgBox fWhat & " not found in active sheet"
End If
End Sub
I want that to trigger the following:
RangePaste Macro
'
'
Selection.Copy
Sheets("Specials").Select
'Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Selection.PasteSpecial paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
'SkipBlanks:=False, Transpose:=False
'Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G11").Select
End Sub
Any ideas??
I have a macro that seeks out and creates a range from a database:
Sub Title_Number_Search()
Dim SearchValue As String
SearchValue = InputBox("Enter Title Code" & Chr(13) & _
"####")
If SearchValue = "" Then
Exit Sub 'user pressed Cancel
Else
Call SelectAll(SearchValue)
End If
End Sub
Sub SelectAll(fWhat As String)
Dim F As Range, U As Range, fAdr As String
With ActiveSheet.UsedRange
Set F = .Find(what:=fWhat & "*", LookIn:=xlValues, lookat:=xlPart)
If Not F Is Nothing Then
fAdr = F.Address
Set U = F
Else
GoTo None
End If
Do
Set F = .FindNext(F)
If F Is Nothing Then Exit Do
If F.Address = fAdr Then Exit Do
Set U = Union(F, U)
Loop
End With
If Not U Is Nothing Then
U.Select
Else
None: MsgBox fWhat & " not found in active sheet"
End If
End Sub
I want that to trigger the following:
RangePaste Macro
'
'
Selection.Copy
Sheets("Specials").Select
'Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Selection.PasteSpecial paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
'SkipBlanks:=False, Transpose:=False
'Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G11").Select
End Sub
Any ideas??