Consulting

Results 1 to 7 of 7

Thread: Kindly help me write these excel macros

  1. #1
    VBAX Newbie
    Joined
    Dec 2010
    Posts
    4
    Location

    Kindly help me write these excel macros

    Write a macro that prints the row and column index of all the cells in the range A1:H8. (ex: prints “1,1” in cell A1, “1,2” in cell B1, etc…).

    Transform the previous macro so that it can be called for any range (not only A1:H8)? Use InputBoxes to ask the desired range. For simplification purpose, assume that the range always start from cell A1.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,445
    Location
    [vba]

    Sub OddRequest()
    Dim rng As Range
    Dim cell As Range

    Set rng = Application.InputBox("Select a range of cells with the mouse", Type:=8)
    For Each cell In rng

    cell.Value = cell.Row & ", " & cell.Column
    Next cell
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Dec 2010
    Posts
    4
    Location
    Thanks a lot. It worked.

  4. #4
    VBAX Newbie
    Joined
    Dec 2010
    Posts
    4
    Location
    please can you PM me with your e-mail address, I really need help on vba.

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,445
    Location
    Then ask it here, that is what the forum is for.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Newbie
    Joined
    Dec 2010
    Posts
    4
    Location

    VBA difficulty

    Thank you.I have attached a file.Kindly help me with them.Kindly use comments in the code to explain steps so I will understand.

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,445
    Location
    I am sorry, that reeks of homework/coursework, which is not what we are about.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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