Make the worksheet dynamic

kvemperor

New Member
Joined
Jan 13, 2023
Messages
31
Office Version
  1. 2021
Platform
  1. Windows
sample.jpg

In this worksheet i have the function in cell G9 =B9+G8-E9 so every time i am putting a value in the column B or in the column E then when i drag down the cell (of the same row)in the column G then i have my result.Is it possible this to make it dynamic?(with vba or any other way? i mean instead of drugging down the cell of the column G down when i am putting a value in the column B or in the column E the result comes automatically in the column G.
I wouldn't mind when i was putting the date in the column F then automatically comes the result in the column G
thank you in advance
 
OMG !!
when i put a value in the column G.Its like i keep an order when i am putting the values in the columns E or G
just I need to this . you adjusted column date entering from G to B , then will change values entering from columns C,F to E,G, right?
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
OMG !!

just I need to this . you adjusted column date entering from G to B , then will change values entering from columns C,F to E,G, right?
Nο🥺 .now i put the values in the columns D and G instead of the columns C and F .I am also putting something to the column E but its an other thing
 
Upvote 0
Nο🥺 .now i put the values in the columns D and G instead of the columns C and F .I am also putting something to the column E but its an other thing
so why you didn't say that from the beginning as I ask you many times?
just post the whole requirements without any adjusting every time until to find help from the rest of others members.
and which you columns entering ?
just I want if you want enter values in columns C ,F as in earlier
anyway try this and see how goes .
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Target.Row < 8 Then Exit Sub
Application.EnableEvents = False
If Target.Column = 5 And Target.Row > 8 Or Target.Column = 7 And Target.Row > 8 Then
Dim LR1 As Integer
LR1 = Range("B" & Rows.Count).End(xlUp).Row
For s = 9 To LR1
Range("I9:I" & s).FormulaR1C1 = "=RC[-6]+R[-1]C-RC[-3]"
Next
End If
Application.EnableEvents = True
End Sub
 
Upvote 1
so why you didn't say that from the beginning as I ask you many times?



anyway try this and see how goes .
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Target.Row < 8 Then Exit Sub
Application.EnableEvents = False
If Target.Column = 5 And Target.Row > 8 Or Target.Column = 7 And Target.Row > 8 Then
Dim LR1 As Integer
LR1 = Range("B" & Rows.Count).End(xlUp).Row
For s = 9 To LR1
Range("I9:I" & s).FormulaR1C1 = "=RC[-6]+R[-1]C-RC[-3]"
Next
End If
Application.EnableEvents = True
End Sub
I apologize for any misunderstanding. You did already a lot for me. I will try this tomorrow (it's here night time here in Greece). I let you know when I try this. Again sorry for any misunderstanding
 
Upvote 0
I will try this tomorrow (it's here night time here in Greece)
no problem
just make sure enter in column B firstly , enter in column E or G .
and if work for you don't forget mark answering .
 
Upvote 0
no problem
just make sure enter in column B firstly , enter in column E or G .
and if work for you don't forget mark answering .
Hallo my friend.Still no working :cry:
ΚΑΡΤΕΛΛΑ ΔΕΙΓΜΑ.xlsm
ABCDEFGHI
1 ONOMA
2
3
4
5
6
7ΗΜΕΡΑΗΜΕΡΟΜΗΝΙΑΑΡ.ΣΥΝΝΑΛΑΓΗΣ ΤΙΜ ΑΞΙΑ ΤΙΜ ΑΡ.ΤΙΜΑΡ.ΣΥΝΝΑΛΑΓΗΣ ENANTI ΑΞΙΑ ENANTI ΠΙΣΤΩΣΗ/ΕΝΑΝΤΙ ΝΕΟ ΥΠΟΛΟΙΠΟ
8 
9 - €
102022Εκ μεταφορας - €
11Τετάρτη01/2/202316.000,00 €TIM 6 ΠΙΣΤΩΣΗ#ΤΙΜΗ!
12Πέμπτη02/2/202323.000,00 €TIM 7 ΠΙΣΤΩΣΗ#ΤΙΜΗ!
13   
14  
15   
16   
17   
ΕΤΑΙΡΙΑ NEO TΕΛΕΥΤΑΙΟ (3)
Cell Formulas
RangeFormula
A11:A400A11=LET(x,B11:B400,IF(x="","",WEEKDAY(x)))
I9:I12I9=C9+I8-F9
F11:F13,F15:F17F11=IF(G11="","",COUNTA($G$11:G11))
C11:C17C11=IF(E11="","",COUNTA($E$11:E11))
H8:H17H8=IF(AND(D8="",G8=""),"",IF(D8<>"",$L$2,$L$3))
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H8:H399Expression=H8=$L$3textNO
H8:H399Expression=H8=$L$2textNO
 
Upvote 0
add

Target.Column = 2 And Target.Row > 8 or

to the if statement
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Column = 2 And Target.Row > 8 or
If Target.CountLarge > 1 Or Target.Row < 8 Then Exit Sub
Application.EnableEvents = False
If Target.Column = 5 And Target.Row > 8 Or Target.Column = 7 And Target.Row > 8 Then
Dim LR1 As Integer
LR1 = Range("B" & Rows.Count).End(xlUp).Row
For s = 9 To LR1
Range("I9:I" & s).FormulaR1C1 = "=RC[-6]+R[-1]C-RC[-3]"
Next
End If
Application.EnableEvents = True
End Sub

Like that?
 
Upvote 0
no here

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Target.Row < 8 Then Exit Sub
Application.EnableEvents = False
If (Target.Column = 2 And Target.Row > 8) or (Target.Column = 5 And Target.Row > 8) Or ( Target.Column = 7 And Target.Row > 8 ) Then
Dim LR1 As Integer
LR1 = Range("B" & Rows.Count).End(xlUp).Row
For s = 9 To LR1
Range("I9:I" & s).FormulaR1C1 = "=RC[-6]+R[-1]C-RC[-3]"
Next
End If
Application.EnableEvents = True
End Sub
 
Upvote 0
Solution
Hallo my friend.Still no working :cry:
sorry buddy!
seems wrong in this line
VBA Code:
Range("I9:I" & s).FormulaR1C1 = "=RC[-6]+R[-1]C-RC[-3]"
just change this
VBA Code:
Range("I9:I" & s).FormulaR1C1 = "=RC[-6]+R[-1]C-RC[-3]"
to this
VBA Code:
Range("I9:I" & s).FormulaR1C1 ="=RC[-4]+R[-1]C-RC[-2]"
then will become
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Target.Row < 9 Then Exit Sub
Application.EnableEvents = False
If Target.Column = 5 And Target.Row > 8 Or Target.Column = 7 And Target.Row > 8 Then
Dim LR1 As Long
LR1 = Range("B" & Rows.Count).End(xlUp).Row
For s = 9 To LR1
Range("I9:I" & s).FormulaR1C1 = "=RC[-4]+R[-1]C-RC[-2]"
Next
End If
Application.EnableEvents = True
End Sub
if the calculation is wrong , just tell me how the formula should be .
 
Upvote 1

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top