Excel 97 ? Set the button's "take focus on click" to False.
But read my other post regarding all the Select stuff you do.
HTH. best wishes Harald
"Jonathan" <Jonathan@discussions.microsoft.com> skrev i melding
news:9ABDFD83-1A31-461D-AA6C-00D4B7693BDD@microsoft.com...
> Oh, btw I am running this code from a command button, but that should
effect
> it should it?
>
> "Bob Phillips" wrote:
>
> > It runs okay for me. What line do you get the error on?
> >
> > --
> > HTH
> >
> > Bob Phillips
> >
> > "Jonathan" <Jonathan@discussions.microsoft.com> wrote in message
> > news:0C61ECF2-CC3F-4CCA-A8C2-541B37F025F9@microsoft.com...
> > > I am trying to copy the value of the last cell with a value on sheet 1
> > column
> > > B to the first blank cell on sheet 2 column B, but I keep getting
errors
> > in
> > > my script (please see below) am I missing something really obvious?
(Error
> > > Message "run-time error 1004")
> > >
> > > Worksheets(2).Cells(1, 1).Value = "CB Barcode"
> > > Worksheets(2).Cells(1, 2).Value = "8 Digit Code"
> > > Worksheets(2).Cells(2, 2).Value = " "
> > > Range("B2").Select
> > > Selection.ClearContents
> > > Worksheets(1).Select
> > > Range("B1").Select
> > > ActiveCell.SpecialCells(xlLastCell).Select
> > > Selection.Copy
> > > Worksheets(2).Select
> > > Range("B2").Select
> > > ActiveSheet.Paste
> > >
> > > Tia
> > >
> > > Jonathan
> > >
> > >
> >
> >
> >
Bookmarks