View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
davesexcel[_11_] davesexcel[_11_] is offline
external usenet poster
 
Posts: 1
Default Inserting row based on critéria using VBA


RSantos Wrote:
HI,

I would like to insert a row when a certain cell has a certain value.
The ideia is to divide the values into weeks, inserting an empty row
after every sunday (where I wiil put the totals of the week), and group
the whole week in order to see just the week total.

Can anyone help me doing this in VBA?


Sub ValSunday()
'
Range("A9").Select

If Selection.Value = "Sunday" Then
'your code here
End If

End Sub




copy and paste this in a normal module,
create a button and assin this macro to it:
once you work on the code and add other code that meets your specs,
you can then paste it into your worksheet change event but thats
another story
work on the macro first


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=516687