Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() Please could somebody tell me the VB code or function to clear cell contents with user input in the adjacent cell Thanks Ashley -- Ashley Frank ------------------------------------------------------------------------ Ashley Frank's Profile: http://www.excelforum.com/member.php...o&userid=26488 View this thread: http://www.excelforum.com/showthread...hreadid=473396 |
#2
![]() |
|||
|
|||
![]()
This code worked for me:
Private Sub Worksheet_Change(ByVal Target As Range) Dim CurrentCell As String If Mid(Target.Address, 2, Len(Target.Address) - InStr(2, Target.Address, "$")) = "B" Then CurrentCell = ActiveCell.Address Range(Target.Address).Select ActiveCell.Offset(0, -1).Value = "" Range(CurrentCell).Select End If End Sub In the VB editor's project pane, right click the relevant tab name, select View Code, and paste that code in. Note: the line that says "If Mid(Target.Address, 2, Len(.... etc" is there to limit this action to a particular column. The code only runs if the user makes an entry in the column you specify, then erases the cell to the immediate left of the cell in which the change was made. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Function syntax to compare cell contents | Excel Worksheet Functions | |||
How do I find the contents of a cell using the "ADDRESS" function. | Excel Worksheet Functions | |||
Delete Cell Value Based on Another Cell T or F | Excel Discussion (Misc queries) | |||
Cell contents vs. Formula contents | Excel Discussion (Misc queries) | |||
Display actual contents of cell | Excel Discussion (Misc queries) |