+ Reply to Thread
Results 1 to 2 of 2

Thread: New at this...need help please.

  1. #1
    Registered User
    Join Date
    02-13-2006
    Posts
    1

    New at this...need help please.

    I am trying to create a macro to populate another worksheet. I did my subtotals, but when I do a link from the subtotal page in the new document, it gives me a specific cell number...I want it to be dynamic and find the cell number.

    For example, on the subtotal page, there are 3 columns and 3 rows for the totals...and I want to pull the total #1 without specifiying the row "C2204". Is there a code/command that will do a find on a key word and then use the cell that is to the right or left of it?

    Sorry so confusing....this is new to me. Thanks much.

  2. #2
    Tom Ogilvy
    Guest

    Re: New at this...need help please.

    Sub FindSubTotal()
    Dim rng As Range
    Set rng = Cells.Find(What:="Subtotal", _
    After:=Range("A1"), _
    LookIn:=xlFormulas, _
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, _
    MatchCase:=False)
    If Not rng Is Nothing Then
    rng.Offset(0, 1).Select
    Else
    MsgBox "Subtotal not found"
    End If
    End Sub

    --
    Regards,
    Tom Ogilvy

    "luvsun27" <luvsun27.2368va_1139840403.7372@excelforum-nospam.com> wrote in
    message news:luvsun27.2368va_1139840403.7372@excelforum-nospam.com...
    >
    > I am trying to create a macro to populate another worksheet. I did my
    > subtotals, but when I do a link from the subtotal page in the new
    > document, it gives me a specific cell number...I want it to be dynamic
    > and find the cell number.
    >
    > For example, on the subtotal page, there are 3 columns and 3 rows for
    > the totals...and I want to pull the total #1 without specifiying the
    > row "C2204". Is there a code/command that will do a find on a key word
    > and then use the cell that is to the right or left of it?
    >
    > Sorry so confusing....this is new to me. Thanks much.
    >
    >
    > --
    > luvsun27
    > ------------------------------------------------------------------------
    > luvsun27's Profile:

    http://www.excelforum.com/member.php...o&userid=31495
    > View this thread: http://www.excelforum.com/showthread...hreadid=511733
    >




+ 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.2.0