#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rubix
 
Posts: n/a
Default Create macro

I would like to input my stock according to item number.

A4 to A1000 are my stock items.

Cell D is my balance.

I would like to create a macro where I can Ctrl + F to find the stock
number but apon pressing Enter such as Stock item #42 which would
appear at say A149 to go directly to D149.

Thanks,
Rube


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Create macro

Sub Macro1()
Dim ans
Dim cell As Range
ans = InputBox("Supply search string")
If ans < False Then
Set cell = Cells.Find(What:=ans, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not cell Is Nothing Then
cell.Offset(0, 4).Select
End If
End If
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Rubix" wrote in message
...
I would like to input my stock according to item number.

A4 to A1000 are my stock items.

Cell D is my balance.

I would like to create a macro where I can Ctrl + F to find the stock
number but apon pressing Enter such as Stock item #42 which would
appear at say A149 to go directly to D149.

Thanks,
Rube




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rubix
 
Posts: n/a
Default Create macro

Thanks Bob this is what I'm looking for. However my stock numbers
range from 2 to 6 didgets. How can I insert code to go to Enter Entire
Cell Content. Right now if I go to 8888 for example then to 42 I get
the next item with a 42 in it such as 554260 or the price in column B.

On Wed, 8 Mar 2006 09:23:46 -0000, "Bob Phillips"
wrote:

Sub Macro1()
Dim ans
Dim cell As Range
ans = InputBox("Supply search string")
If ans < False Then
Set cell = Cells.Find(What:=ans, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not cell Is Nothing Then
cell.Offset(0, 4).Select
End If
End If
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Create macro

Sub Macro1()
Dim ans
Dim cell As Range
ans = InputBox("Supply search string")
If ans < False Then
Set cell = Cells.Find(What:=ans, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not cell Is Nothing Then
cell.Offset(0, 4).Select
End If
End If
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Rubix" wrote in message
...
Thanks Bob this is what I'm looking for. However my stock numbers
range from 2 to 6 didgets. How can I insert code to go to Enter Entire
Cell Content. Right now if I go to 8888 for example then to 42 I get
the next item with a 42 in it such as 554260 or the price in column B.

On Wed, 8 Mar 2006 09:23:46 -0000, "Bob Phillips"
wrote:

Sub Macro1()
Dim ans
Dim cell As Range
ans = InputBox("Supply search string")
If ans < False Then
Set cell = Cells.Find(What:=ans, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not cell Is Nothing Then
cell.Offset(0, 4).Select
End If
End If
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rubix
 
Posts: n/a
Default Create macro

Thanks again Bob, I realized I had to make change to the After string
to Range A1. Works like a charm. I may ask to help make my monthly
database a lot more simplified than the method I am using now.

Currently I have a worksheet made for each day of the month. What I'd
really like to do is have all the days on one worksheet.

Day 1 would be on cell.Offset(0, 4).Select - Day 2 would be on 0, 6
(2 cells per day). Rather than editing macro below to change
cell.Offset I would like to create another macro function to go to a
certain day say Day 2 which is Column F,G then remain in cell F until
day is changed.

Hope this makes sense. If not I can live with what I have until I
decide to learn more about macros.

Rube

On Thu, 9 Mar 2006 10:46:26 -0000, "Bob Phillips"
wrote:

Sub Macro1()
Dim ans
Dim cell As Range
ans = InputBox("Supply search string")
If ans < False Then
Set cell = Cells.Find(What:=ans, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not cell Is Nothing Then
cell.Offset(0, 4).Select
End If
End If
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
How can you create a macro on a protected sheet? Felix Excel Discussion (Misc queries) 2 February 23rd 06 12:37 AM
How do I create a macro that will automatically input lines? cporter Setting up and Configuration of Excel 1 February 22nd 06 10:18 AM
How do i create a macro that saves the filename that is equal to a cell in the sheet? Chukka Excel Discussion (Misc queries) 1 December 6th 05 04:19 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
create autosum macro along with notation on the side pino Excel Worksheet Functions 0 June 16th 05 09:44 PM


All times are GMT +1. The time now is 04:43 PM.

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"