LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting a cell

Another option...

Select A:E (headers in Row 1 only).
Data|Form
You can click the criteria button
search for your Item number
tab to the correct field and type the new number you want.

==========

But if you want a cheap and dirty macro...

Option Explicit
Sub testme()
Dim FoundCell As Range
Dim FindWhat As String
Dim HowMany As Long

HowMany = 3

With Worksheets("sheet1")

Do
FindWhat = InputBox(Prompt:="Item Number?")
If Trim(FindWhat) = "" Then Exit Do

With .Range("a:a")
Set FoundCell = .Cells.Find(what:=FindWhat, _
after:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
lookat:=xlWhole, searchorder:=xlByRows, _
searchdirection:=xlNext)
End With

If FoundCell Is Nothing Then
Beep
MsgBox "Not found!"
Else
HowMany = Application.InputBox(Prompt:="How Many for: " _
& FoundCell.Address(0, 0), _
Default:=HowMany, Type:=1)
If HowMany < 1 Then Exit Do
FoundCell.Offset(0, 4).Value = HowMany
End If
Loop
End With

End Sub

It quits when you hit cancel for either inputbox. And it remembers the previous
quantity--if you don't like that, change the default to what you use the most.




olenavychief wrote:

I used to be a pretty fair BASIC Programmer, but I haven't been able to
devote enough time to learn VBA for Office, I've never done anything that
needed it before. I'm sure this is a really easy one, but I'm really a newbie
to this, so any help would be appreciated.
Here is the situation:
I am trying to post inventory into an excel spreadsheet so that I can import
it into a custom label program to print price & description barcoded labels.
I export the inventory from my accounting program directly into an Excel
workbook, no problem there. Only 4 columns are exported:
"ItemNum" "Desc" "QuanOnHand" "Price"
I add a column heading "NumLabels" so that I know how many labels of any
particular item need printing. This is always the 5th column.
Then using my received inventory's packing slips I can search for the item
numbers, tab over to the "NumLabels" column and enter how many labels to
print.
Here's the problem - that's a LOT of typing! I CTRL-F to get the Find
Dialogue, type the item number I'm looking for, click search, close the Find
Dialogue, tab right 4 cells, type the number of labels - then CTRL-F etc. etc.
I'v tried recording a MACRO a zillion times, but it doesn't capture the
correct keypresses, so no go.
Ideally, I'd like to hit a key, have a find dialogue pop-up, type the item
number, find it, and when closed, automatically tab 4 spaces so I may enter
the number of labels, then open the find dialogue again, basicly a loop until
I type CTRL-X or something to stop it. Can this be done?


--

Dave Peterson
 
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
Excel 2007 single cell selecting muliple cell Submit2s Excel Worksheet Functions 1 February 12th 09 04:52 PM
Selecting a cell entry based on cell validation selection Brutalius Excel Worksheet Functions 2 December 17th 08 03:44 AM
Transfer cell values to another cell by selecting button. Gryndar Excel Worksheet Functions 2 November 24th 08 02:21 AM
Selecting A cell... LeahT Excel Discussion (Misc queries) 6 April 16th 08 06:48 PM
Selecting cell next to a value KimH Excel Programming 4 May 26th 04 02:48 PM


All times are GMT +1. The time now is 07:44 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"