LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Duplicate the contents of a row when text is entered in a cell

Here's a tricky one:

I would like an action to occur each time text is entered into a cell
in Column A. This needs to be done using VB, not a macro. When data is
entered into, say, cell A2, I would like the formulas in cells C2:E2
to be copied down into cells C3:E3.

The purpose of this is to avoid having formulas in cells until they
are needed (i.e. each time a row with formulas is used, a new blank
row with formulas is created).

In doing a web search for a solution, I found the following code
(props to Gord Dibben, circa 2003):

Copy/paste this Event code to your worksheet module.
Select Sheet TabView Code.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col B
On Error GoTo enditall
If Target.Cells.Column = 2 Then
n = Target.Row
If Excel.Range("B" & n).Value < "" Then
Excel.Range("C" & n).Value = Excel.Range("B" & n).Value
End If
End If
enditall:
End Sub

Unfortunately, I am unable to adapt this to my specific
needs...anybody care to take a swing?

 
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
preventing cell contents from being entered twice? AndyWes Excel Discussion (Misc queries) 2 May 11th 06 11:57 PM
Cell contents don't display everything entered? treybreak Excel Discussion (Misc queries) 0 April 25th 06 05:09 PM
Formatted Cell Changes Format When Text Is Entered SundanceKidLudwig Setting up and Configuration of Excel 3 September 30th 05 09:21 PM
Text shown up in other cells everytime a text is entered in 1 cell bioyyy Excel Discussion (Misc queries) 1 August 26th 05 05:26 PM
Entered text value equals a number I specify in another cell Dave S. Excel Worksheet Functions 3 June 12th 05 10:07 PM


All times are GMT +1. The time now is 09:27 PM.

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

About Us

"It's about Microsoft Excel"