+ Reply to Thread
Results 1 to 3 of 3

Macro Problems

  1. #1
    mastermind
    Guest

    Macro Problems

    Okay I am having some trouble writng a code that takes a value from
    Range("k3") and then searches a set Range("J10:J34,L10:L34") for the
    first blank cell. When the first blank cell is determined the code
    will need to initialize the cell with a name, and then move over
    (right) one column and insert the value taken from Range("k3"). Does
    anyone have any idea how this can be accomplished?


  2. #2
    Norman Jones
    Guest

    Re: Macro Problems

    Hi Mastermind,

    Try:

    '=============>>
    Public Sub Tester002()
    Dim SH As Worksheet
    Dim Rng As Range
    Dim Rng2 As Range
    Const sStr As String = "Your_Name" '<<==== CHANGE

    Set SH = ActiveSheet '<<==== CHANGE
    Set Rng = SH.Range("J10:J34, L10:L34")

    On Error Resume Next
    Set Rng2 = Rng.SpecialCells(xlCellTypeBlanks)
    On Error GoTo 0

    If Not Rng2 Is Nothing Then
    With Rng2(1)
    .Name = sStr
    .Offset(0, 1).Value = SH.Range("K3").Value
    End With
    End If
    End Sub
    '<<=============


    ---
    Regards,
    Norman


    "mastermind" <[email protected]> wrote in message
    news:[email protected]...
    > Okay I am having some trouble writng a code that takes a value from
    > Range("k3") and then searches a set Range("J10:J34,L10:L34") for the
    > first blank cell. When the first blank cell is determined the code
    > will need to initialize the cell with a name, and then move over
    > (right) one column and insert the value taken from Range("k3"). Does
    > anyone have any idea how this can be accomplished?
    >




  3. #3
    Robert
    Guest

    Re: Macro Problems

    Thank you on behalf of Mastermind
    --
    Robert




+ Reply to Thread

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