LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default How to display the active row number

I have the following code:
------------
For Each Sh In ActiveWorkbook.Worksheets
If Sh.Name < newWs.Name And Sh.Name < aWs.Name And Sh.Name
< bWs.Name Then

Set rng = Nothing
On Error Resume Next
Set rng = Sh.Range("lblWTotal")
On Error GoTo 0
If rng Is Nothing Then
MsgBox "Sheet " & Sh.Name & " does not contain
lblWTotal"
Else
Sh.Range("lblWTotal").Value = Sh.Name
End If


Sh.Range("G:G").Copy
newRng.PasteSpecial


'replace and add cell reference
newRng.Cells.Replace What:="=SUM(#REF!)",
Replacement:="='" & _
Sh.Name & "'!G" & ActiveCell.Row, _
LookAt:=xlPart, SearchOrder:=xlByRows,
MatchCase:=False


Sh.Range("lblWTotal").Value = "Wkly"

Set newRng = newRng.Offset(0, 1)


End If


Next
------
Basically it copies the column G from every worksheets to another
worksheet. On the new worksheet I want to replace the cells value to
the actual worksheet/cell number

How do i add the actual row number to ='wsName'!G

Using ActiveCell.Row adds 1 to all the cells. I know of Row() but I
dont know how to use Row() in VB.

Thank you,

Sharon

 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Active x control box display order Rich Excel Discussion (Misc queries) 0 April 28th 09 03:02 AM
How can we display the coloured border around the active sheet? BimDim Setting up and Configuration of Excel 1 May 31st 07 02:39 PM
Dynamically display in Active Cell value from 2 rows above it Jocko_MacDuff116 Excel Discussion (Misc queries) 4 May 12th 07 04:08 AM
Dynamically display in active cell the value x-rows above it? Jocko_MacDuff116 Excel Discussion (Misc queries) 0 May 12th 07 01:24 AM
Display of Active Cell in MS Excel 2007 Jasper Excel Discussion (Misc queries) 1 March 28th 07 08:36 PM


All times are GMT +1. The time now is 07:26 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"