Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 3, 8:08*pm, The Code Cage Team <The.Code.Cage.Team.
wrote: Formulae won't make it slow unless you haev 1000's of them, anyway here's some code you can play around with! Code: -------------------- * * Private Sub Worksheet_Change(ByVal Target As Range) * If Target.Cells.Count 1 Then Exit Sub * If Target.Column = 1 Or Target.Address = "$B$1" Then Exit Sub * If Not Intersect(Target, Range("B:B")) Is Nothing Then * If Target < "" And Target.Offset(0, -1) = "" Then * MsgBox "You cannot leave " & Target.Offset(0, -1).Address & " empty!", vbOKOnly, "Missing Data" * Target.ClearContents * NXT: * Target.Offset(0, 1).ClearContents * Target.Offset(0, 2).ClearContents * Target.Offset(0, 5).ClearContents * Target.Offset(0, -1).Select * Exit Sub * ElseIf Target = "" Then * GoTo NXT * ElseIf Not Intersect(Target, Range("B:B")) Is Nothing Then * If Target < "" Then * Target.Offset(0, 1).Value = "Ok" * Target.Offset(0, 2).Value = "Clear" * Target.Offset(0, 5).Value = "Done" * End If * End If * End If * End Sub -------------------- -- The Code Cage Team Regards, The Code Cage Team 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ The Code Cage Team's Profile:http://www.thecodecage.com/forumz/member.php?userid=2 View this thread:http://www.thecodecage.com/forumz/sh...ad.php?t=36374 Hi, In same code, how will I be able to import a specific column (in my case it is column 6 of text file) to column 2 in xl sheet. Text file is '|' delimited and first row has header. It should ignore the header of text file & import column 6 data to column 2 in xl sheet & rest autofill is already mentioned in the above code. If all works fine, then the result would be like: column 2 having data (previously we were enterting value, now we will import from text file a specific column) (same row) column 3, column4 & column 7 with OK, CLEAR & DONE (same as in code) Thx. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill in date into adjacent cell automatically | Excel Discussion (Misc queries) | |||
Auto fill adjacent cells | Excel Discussion (Misc queries) | |||
Auto fill Adjacent cells | Excel Worksheet Functions | |||
auto fill series between to non-adjacent cells | Excel Discussion (Misc queries) | |||
Auto-fill cell based on adjacent cell information.. | Excel Worksheet Functions |