Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Runtime error 91

Hi, all
on the macro der Wert "ID" in Column "b" is not available the Error
Message pop up Runtimeerrot 91 Objectvariable or With-Blockvariable not
set.
Sub Makro5()
'
Dim ID As Integer

Range("D1").Select
ID = Range("D1")
Columns("B:B").Select

Selection.Find(what:=ID, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByColumns,SearchDirection:=xlNext,M atchCase_
:=False, SearchFormat:=False).Activate

ActiveCell.Offset(0, 1).Activate
ActiveCell.Select
Selection.Copy

Range("F1").Select
ActiveSheet.Paste

End Sub


Thanks
Reiner
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Runtime error 91

Hi
use
Sub Makro5()
'
Dim IDrng As range
Dim ID

Range("D1").Select
set IDrng = Range("D1")
ID=IDrng.value
Columns("B:B").Select


--
Regards
Frank Kabel
Frankfurt, Germany


Reiner wrote:
Hi, all
on the macro der Wert "ID" in Column "b" is not available the Error
Message pop up Runtimeerrot 91 Objectvariable or With-Blockvariable
not set.
Sub Makro5()
'
Dim ID As Integer

Range("D1").Select
ID = Range("D1")
Columns("B:B").Select

Selection.Find(what:=ID, After:=ActiveCell, LookIn:=xlValues, LookAt

_
:=xlWhole,

SearchOrder:=xlByColumns,SearchDirection:=xlNext,M atchCase_
:=False, SearchFormat:=False).Activate

ActiveCell.Offset(0, 1).Activate
ActiveCell.Select
Selection.Copy

Range("F1").Select
ActiveSheet.Paste

End Sub


Thanks
Reiner


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Runtime error 91

Sub Test()
Dim FoundCell As Range
On Error Resume Next
Set FoundCell = Range("B:B").Find(Range("D1").Value)
If Not FoundCell Is Nothing Then
FoundCell.Offset(0, 1).Copy Range("F1")
End If
End Sub


--
Jim Rech
Excel MVP
"Reiner" wrote in message
...
| Hi, all
| on the macro der Wert "ID" in Column "b" is not available the Error
| Message pop up Runtimeerrot 91 Objectvariable or With-Blockvariable not
| set.
| Sub Makro5()
| '
| Dim ID As Integer
|
| Range("D1").Select
| ID = Range("D1")
| Columns("B:B").Select
|
| Selection.Find(what:=ID, After:=ActiveCell, LookIn:=xlValues, LookAt _
| :=xlWhole, SearchOrder:=xlByColumns,SearchDirection:=xlNext,M atchCase_
| :=False, SearchFormat:=False).Activate
|
| ActiveCell.Offset(0, 1).Activate
| ActiveCell.Select
| Selection.Copy
|
| Range("F1").Select
| ActiveSheet.Paste
|
| End Sub
|
|
| Thanks
| Reiner


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Runtime error 91

Jim Rech wrote:

Sub Test()
Dim FoundCell As Range
On Error Resume Next
Set FoundCell = Range("B:B").Find(Range("D1").Value)
If Not FoundCell Is Nothing Then
FoundCell.Offset(0, 1).Copy Range("F1")
End If
End Sub



Thanks

it's easy but it's works

Reiner
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
xpath error? Runtime Error 13 type mismatch Steve M[_2_] Excel Discussion (Misc queries) 0 January 17th 08 01:16 AM
xpath error? Runtime Error 13 type mismatch SteveM Excel Discussion (Misc queries) 1 December 4th 07 09:16 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 10:24 AM.

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

About Us

"It's about Microsoft Excel"