Marco / code for cell on inserted row

mohamad

New Member
Joined
Oct 1, 2003
Messages
2
(y)
Help
I need a macro or code to put a data cell (H14) into C column cell after inserting a row anywhere on sheet.
ie. H14 in row 16, column C, or
H14 in row 50, Column C.
Hope I explained this properly.

Thanks a bunch

( somewhere in the western desert)
mohamad
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Maybe:

Code:
Sub xxx()
ActiveCell.EntireRow.Insert Shift:=xlDown
Cells(ActiveCell.Row, 3) = Range("H14")
End Sub
 

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,526
Hi,

Welcome to the board.

If I understand your requirement correctly, I think you are wanting an event to insert data when you insert a row into your spreadsheet - right?

If so (and apologies if I'm wroong), I dont know of any event which will detect the insertion of a row. Perhaps you could write a 'BeforeDoubleClick' event to actually insert the row & then insert the data into the appropriate cell i the row.

HTH

Alan
 

Forum statistics

Threads
1,186,165
Messages
5,956,332
Members
438,247
Latest member
UZev

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top