View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sagar Sagar is offline
external usenet poster
 
Posts: 5
Default Range in Macro to change after rows inserted

you can use some project library objects to access and modify the paticular
parts of codes. but there is a possibility that this kind of code will get
caught by Antivirus softwares as a false positive.

"wizardmalcolm" wrote:

Hi
I use the following macro (copied from this group)
When I insert rows above the range, I need the range to adjust accordingly.
I have tried adapting similar answers found here by naming the range but
cannot get it to work.
Any help would be appreciated.


Private Sub CommandButton15_Click()
Dim C As Range
With ActiveSheet.Range("j69:j127")
Do
Set C = .Find("", LookIn:=xlValues, LookAt:=xlWhole, _
MatchCase:=False)
If C Is Nothing Then Exit Do
C.EntireRow.Hidden = True
Loop
End With
End Sub

Thanks
Malcolm