Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like a code if anyone could help please to delete the contents of a
cell based on the data in another cell. I would like it so that if the activecell offset by 4 = Mech, then activecell offset by 10 is deleted. I need it using activecell as it is all tied into a userform that opens on various cells in column C, therefore I cannot reference a particular cell. Any ideas Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If ActiveCell.Offset(0, 4).Value = "Mech" Then
ActiveCell.Offset(0, 10).ClearContents End If |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Offset to the right
or Offset down? -- Gary''s Student "Woodi2" wrote: I would like a code if anyone could help please to delete the contents of a cell based on the data in another cell. I would like it so that if the activecell offset by 4 = Mech, then activecell offset by 10 is deleted. I need it using activecell as it is all tied into a userform that opens on various cells in column C, therefore I cannot reference a particular cell. Any ideas Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming horizontal offset:
Sub clearit() With ActiveCell If .Offset(0, 4).Value = "Mech" Then .Offset(0, 10).Clear End If End With End Sub -- Gary''s Student - gsnu200839 "Woodi2" wrote: I would like a code if anyone could help please to delete the contents of a cell based on the data in another cell. I would like it so that if the activecell offset by 4 = Mech, then activecell offset by 10 is deleted. I need it using activecell as it is all tied into a userform that opens on various cells in column C, therefore I cannot reference a particular cell. Any ideas Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that works great.
In answer to the first question, yes, its offset to the right. How could I include to lock the cell in this code. I already protect the sheet under another code so dont need to worry about that. "Test" wrote: If ActiveCell.Offset(0, 4).Value = "Mech" Then ActiveCell.Offset(0, 10).ClearContents End If |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To lock the cleared cell:
Sub clearit() With ActiveCell If .Offset(0, 4).Value = "Mech" Then .Offset(0, 10).Clear .Offset(0, 10).Locked = True End If End With End Sub -- Gary''s Student - gsnu200839 "Woodi2" wrote: Thanks, that works great. In answer to the first question, yes, its offset to the right. How could I include to lock the cell in this code. I already protect the sheet under another code so dont need to worry about that. "Test" wrote: If ActiveCell.Offset(0, 4).Value = "Mech" Then ActiveCell.Offset(0, 10).ClearContents End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
ActiveCell Offset | Excel Programming | |||
Activecell Offset | Excel Programming | |||
ActiveCell.Offset w/ VBA | Excel Programming | |||
activecell offset | Excel Programming |