Results 1 to 4 of 4

Macro to effect cell based on column

Threaded View

  1. #1
    Registered User
    Join Date
    11-20-2008
    Location
    UK
    Posts
    36

    Smile Macro to effect cell based on column

    I wasnt sure how to name this problem, but here goes.

    Option Explicit
    
    Sub Macro_Insert()
    '
    ActiveCell = ActiveCell & MyInputBox
    With ActiveCell.Characters(Start:=1, Length:=19).Font
    .Name = "Arial"
    .FontStyle = "Regular"
    .Size = 12
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = xlAutomatic
    End With
    With ActiveCell.Characters(Start:=20, Length:=5).Font
    .Name = "Arial"
    .FontStyle = "Bold"
    .Size = 12
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = xlAutomatic
    End With
    
    End Sub
    
    Function MyInputBox() As String
    
      While MyInputBox = "Enter your input text HERE" Or MyInputBox = ""
        MyInputBox = InputBox("This is my InputBox", "MyInputTitle", "Enter your input text HERE")
      Wend
      
    End Function
    The code above takes the value of a cell in on my worksheet and adds a further value ontop of it.

    The problem - I need to be able to use this formula on the rows numbered 5 by selecting only the column needed.

    Example;Column B is selected. When I activate the macro it will effect B5.
    Column CD is selected. When I activate it will effect CD5.

    And so on.

    Thanks in Advance!
    Last edited by Irprogram; 12-01-2008 at 04:00 AM.

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