Help Needed ... Probably simple for you gurus ... locking cell afterdata entered and

P

pmitch8484

positioning next cell after enter is hit

I am very computer illiterate and have searched and experimented for 2
days with limited success

here is currently what the macro does

when data is entered into a cell that cell is filled with the color
green....simple...and works

also there is 3 different columns with data being
entered...A....B....C....after data is entered in C it automatically
puts the current date in the corresponding cell in column D....that is
somewhat ok...would like it to time stamp it also

here is features that I would like to add

Once data is entered to a cell I would like to lock that data so it
cannot be changed....also after data is entered into a cell on column
C as I said a date is also posted in corresponding cell in column
D...I would like the date/timestamp to be locked also

also to input data we will be using a bar code scanner that is
programmed to hit enter after data is collected...so for
example....when we scan data for column a row 2 and enter is
hit(through the Bar Scanner) it goes down to row 3...instead I would
like it to go to column B and same row....then after that goto column
C same row...then after that go to column a but down a row


I attached the simple spreadsheet

any help would be greatly appreciated

also my email is (e-mail address removed) nand if replied there I could
send a copy of the spreadsheet for someone to help

thanks
 
G

GS

pmitch8484 wrote on 1/24/2012 :
positioning next cell after enter is hit

I am very computer illiterate and have searched and experimented for 2
days with limited success

here is currently what the macro does

when data is entered into a cell that cell is filled with the color
green....simple...and works

also there is 3 different columns with data being
entered...A....B....C....after data is entered in C it automatically
puts the current date in the corresponding cell in column D....that is
somewhat ok...would like it to time stamp it also

here is features that I would like to add

Once data is entered to a cell I would like to lock that data so it
cannot be changed....

Protect the sheet with a password. You can still change cells while
protected via VBA IF you set 'UserInterfaceOnly:=True' when applying
protection.
also after data is entered into a cell on column
C as I said a date is also posted in corresponding cell in column
D...I would like the date/timestamp to be locked also

Don't use the VBA Date() function. Use the Now() function instead.
also to input data we will be using a bar code scanner that is
programmed to hit enter after data is collected...so for
example....when we scan data for column a row 2 and enter is
hit(through the Bar Scanner) it goes down to row 3...instead I would
like it to go to column B and same row....then after that goto column
C same row...then after that go to column a but down a row

You can set the default behavior for this on the 'Edit' tab in
'Options'. What you can't do here is choose more than one direction.

To accomplish moving to the next row in colA you need to use the
Worksheet_Change event and test which column the 'Target' cell is in...

Sample code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = Columns("C") Then
Cells(Target.Row + 1, "A").Select
End If
End Sub

To insert this code, right-click the sheet tab and select 'View Code',
then paste the code into the code window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top