Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Please give me help
How I can write a macro in excel for copy and paste a formula with depending upon the value of next right cell For example I have a formula in cell A1 to get numeric value from alpha numeric value in cell B1 . That forumula I have to copy down from A upto the data contained in next cell B . ie, that may to copy from A1..A10 or from A1..30 that is depending the data of B cell Please Help With Thanks and Regdards Pol |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The best way is to use a worksheet change macro. When the data in colum nB
is entered automatically put the formula to the cell immediately to the left. Private Sub Worksheet_Change(ByVal Target as Range) if Target.Column = 2 then Target.offset(0,-1).formula = "=B" & Target.Row & "+1" end if End Sub Which will put in Column A5 "= B5 + 1" when cell B5 is changed "pol" wrote: Please give me help How I can write a macro in excel for copy and paste a formula with depending upon the value of next right cell For example I have a formula in cell A1 to get numeric value from alpha numeric value in cell B1 . That forumula I have to copy down from A upto the data contained in next cell B . ie, that may to copy from A1..A10 or from A1..30 that is depending the data of B cell Please Help With Thanks and Regdards Pol |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Option Explicit
Sub Testme() Dim Wks as worksheet dim LastRow as long set wks = activesheet with activesheet lastrow = .cells(.rows.count,"B").end(xlup).row .range("a1:A" & lastrow).formular1c1 = .range("A1").formular1c1 end with End sub pol wrote: Please give me help How I can write a macro in excel for copy and paste a formula with depending upon the value of next right cell For example I have a formula in cell A1 to get numeric value from alpha numeric value in cell B1 . That forumula I have to copy down from A upto the data contained in next cell B . ie, that may to copy from A1..A10 or from A1..30 that is depending the data of B cell Please Help With Thanks and Regdards Pol -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thnks a lot . thnks again
"Dave Peterson" wrote: Option Explicit Sub Testme() Dim Wks as worksheet dim LastRow as long set wks = activesheet with activesheet lastrow = .cells(.rows.count,"B").end(xlup).row .range("a1:A" & lastrow).formular1c1 = .range("A1").formular1c1 end with End sub pol wrote: Please give me help How I can write a macro in excel for copy and paste a formula with depending upon the value of next right cell For example I have a formula in cell A1 to get numeric value from alpha numeric value in cell B1 . That forumula I have to copy down from A upto the data contained in next cell B . ie, that may to copy from A1..A10 or from A1..30 that is depending the data of B cell Please Help With Thanks and Regdards Pol -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
adding cells upto and including a specified cell | Excel Discussion (Misc queries) | |||
I want the result of formula resyricted upto 2 decimals | Excel Worksheet Functions | |||
how to execute a formula copied into an excel cell | Excel Worksheet Functions | |||
formula to round up any number less than 35 upto 35. | Excel Discussion (Misc queries) | |||
how do i make a cell date sensitive to execute a formula or input. | Excel Discussion (Misc queries) |