Results 1 to 4 of 4

Modifying VB Code:Excell Macro and Visal Basic Programming

Threaded View

  1. #1
    Registered User
    Join Date
    08-27-2009
    Location
    GR
    MS-Off Ver
    Excel 2007
    Posts
    2

    Modifying VB Code:Excell Macro and Visal Basic Programming

    Hello All.

    I am very new to using Excell Macros, infact just a few hours of use till now.I need a quick help on Macros.
    I have a formula in cell B4, which I would normally drag all the way to another cell,B14 .So I created the macro , by pushing the record Macro option. Here it is below.

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        Range("B4").Select
        Selection.AutoFill Destination:=Range("B4:B14"), Type:=xlFillDefault
        Range("B4:B14").Select
    End Sub
    Question : How can I change this script so that the Macro is executed from cell B4 to BX , the number X , would be decided by a value in cell B2. If the value is 10 ,
    then the macro should execute from "Cell:B4" till "Cell:Address of B4 + 10"
    Last edited by aero777; 08-27-2009 at 02:07 AM. Reason: Complying to Forum Rules

Thread Information

Users Browsing this Thread

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

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