LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Why are the two codes below not getting the right formula for myworksheet event change formula?

Why are the two codes below not getting the right formula for my
worksheet event change formula? The remaining ones do work, but these
two are not getting the right results.

Target.Offset(0, 6).FormulaR1C1 = "=RC[-2]&RC[-5]"
Target.Offset(0, 7).FormulaR1C1 = "=RC[-2]&RC[-5]"

I'm trying to get both column G & H to show a combined value of data
in other columns.

Column G should show result by combining data from column E & B, while
column H should show result by combining data from column F & C.

Column G is showing: =RC[-2]&RC[-5] when it should show
numbers...something like 654154845 if 6541 is in column E and 54845 is
in column B.

Same result with column H.

----------------------

My full worksheet event change/ selection code I have is below is as
follows:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim C As Range, D As Range
Set D = Intersect(Range("A:A"), Target)
If D Is Nothing Then Exit Sub
For Each C In D

Target.Offset(0, 6).FormulaR1C1 = "=RC[-2]&RC[-5]"
Target.Offset(0, 7).FormulaR1C1 = "=RC[-2]&RC[-5]"

Target.Offset(0, 9).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC7,M.A.!
R2C1:R5708C5,4,FALSE))=TRUE,0,VLOOKUP(RC7,M.A.!R2C 1:R5708C5,4,FALSE))"
' - For Column J
Target.Offset(0, 10).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC8,'Vacation
Trip'!R2C1:R4573C3,2,FALSE))=TRUE,0,VLOOKUP(RC8,'V acation Trip'!
R2C1:R4573C3,2,FALSE))" ' - For Column K
Target.Offset(0, 11).FormulaR1C1 = "=RC[-2]-RC[-1]" ' - For Column L
Target.Offset(0, 12).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC7,M.A.!
R2C1:R5392C5,5,FALSE))=TRUE,0,VLOOKUP(RC7,M.A.!R2C 1:R5392C5,5,FALSE))-
IF(ISNA(VLOOKUP(RC8,'Vacation Trip'!R2C1:R4573C3,3,FALSE))=TRUE,
0,VLOOKUP(RC8,'Vacation Trip'!R2C1:R4573C3,3,FALSE))" ' - For Column M
Target.Offset(0, 13).Value = "1" ' - For Column N
Target.Offset(0, 14).FormulaR1C1 = "=RC[-2]*RC[-1]" ' - For Column O
Target.Offset(0, 16).FormulaR1C1 = "=IF(RC[-1]="""","""",TODAY()-RC
[-1])" ' - For Column Q

Next C

End Sub

----------------------------

I appreciate your continued assistance!!

Thanks!
 
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
Combine 2 worksheet event change codes winnie123 Excel Programming 5 October 19th 09 05:54 AM
Copy value from formula result on event change of cell value [email protected] Excel Programming 3 June 2nd 08 09:17 AM
Code with formula interfering in worksheet change event Arnold[_3_] Excel Programming 2 January 26th 07 11:28 AM
combine change event codes J.W. Aldridge Excel Programming 2 January 20th 07 04:42 PM


All times are GMT +1. The time now is 02:17 AM.

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"