Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi ChuckF
Try this in your worksheet's code (right-click the sheet tab and select View Code): Private Sub Worksheet_Change(ByVal Target As Range) Dim newcell As Range If Target < Range("J2") Then Exit Sub Application.EnableEvents = False Set newcell = Range("IV2").End(xlToLeft).Offset(0, 1) If newcell.Column < 26 Then Range("Z2").Value = Target Else newcell.Value = Target End If Set newcell = Nothing Target.Select Target.ClearContents Application.EnableEvents = True End Sub I don't know if you wanted Z to be the first column to include your data but I put the check in anyway, remove it if it's not necessary. Be aware that there are only 256 columns in a worksheet. If you're going to be entering a lot of data you might want to consider going down rows rather than across columns. Regards Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |