Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To execute a formula upto in a cell

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default To execute a formula upto in a cell

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default To execute a formula upto in a cell

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   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To execute a formula upto in a cell

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
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
adding cells upto and including a specified cell Colin[_3_] Excel Discussion (Misc queries) 6 May 22nd 08 08:51 AM
I want the result of formula resyricted upto 2 decimals sbkshatriya Excel Worksheet Functions 1 June 29th 07 01:14 PM
how to execute a formula copied into an excel cell Das K Excel Worksheet Functions 1 December 13th 06 07:01 AM
formula to round up any number less than 35 upto 35. Bro40dz Excel Discussion (Misc queries) 5 October 26th 06 07:57 PM
how do i make a cell date sensitive to execute a formula or input. ebuzz13 Excel Discussion (Misc queries) 2 January 20th 05 08:33 PM


All times are GMT +1. The time now is 04:08 PM.

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"