Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this - make sure that the names column is selected
before it is run. It assumes that the range starts in row 1 with the data in row 2. Sub fillFormulas() Dim rng As Range Dim i As Integer, r As Integer 'activecell should be in the names column r = ActiveCell.CurrentRegion.Rows.Count col = ActiveCell.Column For i = 2 To r Cells(i, col + 1).Formula = "=SUM(RC[-6]:RC[-2])" Next i End Sub Regards Peter -----Original Message----- Hi folks, here is my problem. I have a column of names (may be in any column depending on the workbook, but lets assume col B) with an empty column to the right of it(col C) . I want to write a macro that will input a formula in each cell of column C if there is a name in the corresponding cell of col B. There will be no blank cells in col B so the first blank cell will be at the end of the list and should stop the macro. Can anyone help with some code ideas? Thanks.:) ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
extract data from a range based on other cell's input | Excel Discussion (Misc queries) | |||
List Box - For Input Range can I use named range in another workbo | Excel Worksheet Functions | |||
Macro to insert a formula based on a range | Excel Discussion (Misc queries) | |||
Trying to select a specific range based on the time value of user form input | New Users to Excel | |||
Select cell from range based on input in excel xp | Excel Discussion (Misc queries) |