Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default New at this...need help please.


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

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

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

--
luvsun2
-----------------------------------------------------------------------
luvsun27's Profile: http://www.excelforum.com/member.php...fo&userid=3149
View this thread: http://www.excelforum.com/showthread.php?threadid=51173

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in
message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"