Any excel macro experts out there, I need help? - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit
Expired

Any excel macro experts out there, I need help?

Gooner77 Avatar
2y, 5m agoPosted 2 years, 5 months ago
I am trying to record a simple macro (in excel 2007) which finds a time in another workbook. But when I try to run it after recording it I keep getting this "run-time error 91"

I have tried googling it with no luck?

The coding is below?

' Keyboard Shortcut: Ctrl+q
'
ActiveWindow.ActivateNext
ActiveCell.Offset(1, 0).Range("A1").Select
Cells.find(What:="18:00", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveWindow.ActivateNext
End Sub
Gooner77 Avatar
2y, 5m agoPosted 2 years, 5 months ago
Options
Best Answer
Gooner77
hockeygod76
Have you tried putting the macro into debug and watching to see what statement it errors on? Should give you a good place to start.

Yes thanks, I get this but don't know where to go from there


http://oi62.tinypic.com/2l9i0jl.jpg

change "LookIn:=xlFormulas" to "LookIn:=xlValues"

All Responses

(10) Jump to unreadPost an answer
Responses/page:
#1
I would suggest posting this with some sample data to MrExcel.com or a similar Excel based site.
#2
Have you tried putting the macro into debug and watching to see what statement it errors on? Should give you a good place to start.
#3
I am trying to record a simple macro (in excel 2007) which finds a time in another workbook

I cannot see in your coding where the other workbook is identified

All I can see is the coding states "ActiveWindow" which to me means the code looks at the front most active window
#4
hockeygod76
Have you tried putting the macro into debug and watching to see what statement it errors on? Should give you a good place to start.

Yes thanks, I get this but don't know where to go from there


http://oi62.tinypic.com/2l9i0jl.jpg

Edited By: Gooner77 on Jun 20, 2014 14:41
#5
philphil61
I am trying to record a simple macro (in excel 2007) which finds a time in another workbook

I cannot see in your coding where the other workbook is identified

All I can see is the coding states "ActiveWindow" which to me means the code looks at the front most active window


Hi it is looking at this table which is active but returns the error


http://oi57.tinypic.com/11t7ei9.jpg
#6
Gooner77
hockeygod76
Have you tried putting the macro into debug and watching to see what statement it errors on? Should give you a good place to start.

Yes thanks, I get this but don't know where to go from there


http://oi62.tinypic.com/2l9i0jl.jpg

change "LookIn:=xlFormulas" to "LookIn:=xlValues"
#7
hockeygod76
Gooner77
hockeygod76
Have you tried putting the macro into debug and watching to see what statement it errors on? Should give you a good place to start.

Yes thanks, I get this but don't know where to go from there


http://oi62.tinypic.com/2l9i0jl.jpg

change "LookIn:=xlFormulas" to "LookIn:=xlValues"


Awesome, that works a treat. Thank you very much for the help X)
#8
change "LookIn:=xlFormulas" to "LookIn:=xlValues"[/quote]
Hi hockeygod76 , would you be able to guide me in the right direction about learning macros , specifically for gaming , I haven't a clue where to even start or what type of program I will need. The reason is many players are using macros to help them out and I have only just found this out as I'm new to pc gaming.

Thanks in advance
#9
Crusader777
change "LookIn:=xlFormulas" to "LookIn:=xlValues"

Hi hockeygod76 , would you be able to guide me in the right direction about learning macros , specifically for gaming , I haven't a clue where to even start or what type of program I will need. The reason is many players are using macros to help them out and I have only just found this out as I'm new to pc gaming.

Thanks in advance[/quote]
That's a whole different level of macro to the standard excel macro's that this thread is talking about, and way out of my comfort zone I'm afraid :)
#10
hockeygod76
Gooner77
hockeygod76
Have you tried putting the macro into debug and watching to see what statement it errors on? Should give you a good place to start.

Yes thanks, I get this but don't know where to go from there


http://oi62.tinypic.com/2l9i0jl.jpg

change "LookIn:=xlFormulas" to "LookIn:=xlValues"


Well played!

Post an Answer

You don't need an account to leave a response. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!