Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scoops
 
Posts: n/a
Default Macro help

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"