Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that works perfectly
"Jim Thomlinson" wrote: Sub DeleteStock() Dim wksMain As Worksheet Dim wksToSearch As Worksheet Dim rngToFind As Range Dim rngToSearch As Range Dim rngFound As Range Set wksMain = Sheets("Sheet1") 'sheet with the button Set rngToFind = wksMain.Range("A2") 'Cell to look up Set wksToSearch = Sheets("Sheet2") 'Sheet to search Set rngToSearch = wksToSearch.Columns("B") 'Range to search Set rngFound = rngToSearch.Find(rngToFind.Value) If rngFound Is Nothing Then MsgBox "Sorry that part was not found" Else rngFound.Offset(0, 3).ClearContents End If End Sub -- HTH... Jim Thomlinson "Y Sbuty" wrote: The stock number is unique and stored in column B, when the stock numer is found, i need to clear the 3 cells to the right of the stock number (same row), but leaving the stock number "Jim Thomlinson" wrote: Does/could the stock number exist more than once on the second sheet meaning that more than one cell is potentially going to need to be cleared? -- HTH... Jim Thomlinson "Y Sbuty" wrote: Hello, I am trying to set up a stock control spreadsheet... What i'd like to be able to do is enter a stock number in a cell on sheet1, press a 'delete' button, it would then lookup the stock number in a list on sheet2, and then delete 3 cells to the right of the stock number. It sounds easy enough, but i'm struggling a bit! Any help would be greatly appreciated, Thanks, YS |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cells.Clear | Excel Discussion (Misc queries) | |||
clear contents cells of unprotected cells | Excel Programming | |||
Clear Cells | Excel Discussion (Misc queries) | |||
Clear cells with #N/A | Excel Programming | |||
Clear cells range if certain cells are all empty | Excel Programming |