Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to transfer #'s from one column to the next
I am setting up a spreadsheet (budget purposes) and what I am trying to do is
when you enter the budget number and amount in 2 separate columns, I want the amount to automatically go under the budget number on the spreadsheet. Any suggestions? I know excel pretty good, but am not the greatest with forumulas. -- TP |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to transfer #'s from one column to the next
right click on the worksheet and put in code like this.
Assume the budget amount will be placed in cell B2 and the budget number in A2 Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ErrHandler If Target.Address = "$B$2" Then Application.EnableEvents = False s = Target.Offset(0, -1).Value Target.Offset(0, -1).ClearContents Set rng = Cells.Find(What:=s, _ After:=ActiveCell, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then If IsEmpty(rng.Offset(1, 0)) Then Set rng = rng.Offset(1, 0) Else Set rng = rng.End(xlDown)(2) End If rng.Value = Target Target.ClearContents Else MsgBox s & " was not found" End If End If ErrHandler: Application.EnableEvents = True End Sub This is just a guess since I don't know anything about the layout of your sheet. -- Regards, Tom Ogilvy "Tonya" wrote: I am setting up a spreadsheet (budget purposes) and what I am trying to do is when you enter the budget number and amount in 2 separate columns, I want the amount to automatically go under the budget number on the spreadsheet. Any suggestions? I know excel pretty good, but am not the greatest with forumulas. -- TP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
need formula: # entered in column B will transfer to column D | Excel Worksheet Functions | |||
transfer a column into a row? | Excel Discussion (Misc queries) | |||
add numbers in a column and transfer result to another column | Excel Worksheet Functions | |||
Column transfer | Excel Programming | |||
transfer data from one column into another column | Excel Discussion (Misc queries) |