Re: Selecting a cell

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Trying to number two sections two different ways
    ... But you were instructed to use Current Position: Plain Number, which gives you a simple PAGE field, left-aligned, in the default header/footer paragraph. ... If you just intend to change the format of the page number, without changing the position of the number, then it doesn't matter whether you insert it before or after inserting the break. ... But I know I found a button that gives you a dialogue box to position numbers which I can't find at the moment. ... Also there is a page break button on the Insert tab that I think just makes a break on the fly because if you click it I don't see a choice of type of breaks and possibly clicking that at times put in all those unwanted page breaks I am now deleting. ...
    (microsoft.public.word.numbering)
  • Re: How can I format label name as I loop through records?
    ... I'm using a tab control to ... > identify all the potential subform records, ... > I have created small 'marker' labels above each tab and want to make ...
    (microsoft.public.access.formscoding)
  • Re: Trying to number two sections two different ways
    ... The explanation for the items on the Line and Page Breaks tab of the Paragraph dialog is: ... Widow/Orphan control Prevents Microsoft Word from printing the last line of a paragraph by itself at the top of a page or the first line ... This has flumoxed me for over a day in trying to move this document forward and actually write it because I can't get the front matter Roman Numeral numbered and the second of two sections regular numbered 1, 2, 3 etc. ... the only place (and I changed the text size of my Win 7 display from 125% to 100% to be positive I wasn't missing anything on the ribbon or any dialogue box) that I see a Page Breaks tab is on the Page Setup Tab>?ParagraphDialogue Box>to the right is a Line and Page Breaks Tab on that dialogue box. ...
    (microsoft.public.word.numbering)
  • Re: flag notes on tab
    ... "Damon Heron" wrote: ... the labels, if you have room. ... What I'd like to be able to do is that from the main tab, ... I was able to somewhat "fix" my issue using a msgbox. ...
    (microsoft.public.access.formscoding)
  • Best way to approach custom form for 6 different entries?
    ... creates the dialogue box automatically; there are so many different things ... user input and dump that info into labels. ... Other tutorials have had the same problem. ... need a dialogue box that repeats the info requests at least 6 times so that ...
    (microsoft.public.word.vba.userforms)