Results 1 to 6 of 6

Dynamic Formula filldown in VBA

Threaded View

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,785

    Dynamic Formula filldown in VBA

    Hello

    In my attached sample workbook I have data in column B & D.
    I wan

    1) IF I select Cell A1 the my formula should shoot down from A1 to A& last row with data of the column B

    And If
    2) I select C1 then the my formula should shoot down from C1 to C& last row with data of the column C
    I am using bellow code but it is doing something very strange
    Sub FillFormula()
    Dim ws As Worksheet
    Dim irow As Long
    Set ws = Sheets("sheet1")
    irow = ws.Cells(ws.Rows.Count, ActiveCell.Column + 1).End(xlUp).Row
    Range(ActiveCell.Column & ActiveCell.Row & ":" & ActiveCell.Column & irow).Formula _
    = "=1+1"
    End Sub
    Thanks in advance
    Imran Bhatti
    Attached Files Attached Files
    Teach me Excel VBA

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Simple formula FillDown in VBA
    By Fowzee1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2015, 01:11 AM
  2. Advice and help with a copy past code or filldown formula code
    By KELLIS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 02:07 PM
  3. VBA help needed for filldown formula for non blank cells
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2013, 01:39 AM
  4. [SOLVED] VBA to Filldown Every Other Column with Formula
    By msawyer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2013, 02:29 PM
  5. macro for filldown a formula
    By judasdac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2009, 01:11 PM
  6. Filldown Formula
    By Carlie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2006, 06:59 PM
  7. Macro Filldown only with Formula
    By Ben Noall in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2006, 10:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1