PC Review


Reply
Thread Tools Rate Thread

AUTO FILL ADJACENT CELL WITH SPECIFIED VALUE

 
 
Sinner
Guest
Posts: n/a
 
      3rd Dec 2008
Hi,

I have an xl sheet in which I have 8 columns.

From row2, when I enter a value in column1 & column2, I want to auto
fill cell (same row) of column 3, column4 & column 7 with OK, CLEAR &
DONE.

A clear button will clear the sheet from row2 to end of sheet so that
the headers in row 1 are intact & sheet is ready for re-use.
Need a small vb code which will ease & avoid formulas & run in
background.


Thx.
 
Reply With Quote
 
 
 
 
Sinner
Guest
Posts: n/a
 
      3rd Dec 2008
On Dec 3, 5:02*pm, The Code Cage Team <The.Code.Cage.Team.
3ju...@thecodecage.com> wrote:
> A simple if statement can suffice for your wording like:
> =IF(AND(A1<>"",B1="Yes"),"Ok","") so this formula says if the cell A1is
> not blank and the cell B1 contains the word Yes then display the word
> Ok.
>
> Does this help?
>
> --
> 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


thanks.
Well yes but as I would go down the sheet, it would increase
calculation time & make it slow since formulas are involved.
I guess a code will definitely speed up the required.

Thx.
 
Reply With Quote
 
Sinner
Guest
Posts: n/a
 
      20th Dec 2008
On Dec 3, 8:08*pm, The Code Cage Team <The.Code.Cage.Team.
3ju...@thecodecage.com> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto fill adjacent cells KenM Microsoft Excel Misc 3 21st Nov 2008 02:29 AM
Auto fill Adjacent cells =?Utf-8?B?U2ltb24gQmxhY2tidXJu?= Microsoft Excel Worksheet Functions 7 27th Sep 2007 04:50 PM
auto fill series between to non-adjacent cells =?Utf-8?B?TWFuc3Rlcg==?= Microsoft Excel Misc 1 3rd Jun 2007 11:09 AM
Auto-fill cell based on adjacent cell information.. =?Utf-8?B?c2Fucw==?= Microsoft Excel Worksheet Functions 1 17th Oct 2005 11:38 PM
Auto fill between non-adjacent cells Ken Elder Microsoft Excel Discussion 2 1st Jan 2004 09:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:00 PM.