A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Obtain row number of active cell



 
 
Thread Tools Display Modes
  #1  
Old January 8th, 2008, 12:31 PM posted to microsoft.public.excel.worksheet.functions
Jive
external usenet poster
 
Posts: 27
Default Obtain row number of active cell

Hi i am having a problem with the following section of code within the larger
peice below it.

DBaseRow = ActiveRow
Cells(DBaseRow, 5) = TDMCAD

The whole code is suppose to decect specific changes in the "DesignManager"
Workbook and update the values in the "ProjectsMaster" Workbook but i am
having problems obtaining the row address to use in the cell adresses to
paste the values.

This will no doubt be a simple answer but i am banging my head on the wall
as you read this in frustration. Thanks in advance.

Application.ScreenUpdating = False
Application.DisplayAlerts = False
DesignManager = ActiveWorkbook.Name
Workbooks.Open Filename:="J:\ProSys\DataBase\Projects Master.xls",
ProjectsMaster = ActiveWorkbook.Name
Windows(DesignManager).Activate

For i = 1 To 1000
If Cells(i, 12) = True Then
ProjectID = Cells(i, 1).Value
DMCAD = Cells(i, 5).Value
DMType = Cells(i, 6).Value
DMNotes = Cells(i, 10).Value
Windows(ProjectsMaster).Activate
Cells.Find(What:=ProjectID, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
DBaseRow = ActiveRow
Cells(DBaseRow, 5) = DMCAD
Cells(DBaseRow, 6) = DMType
Cells(DBaseRow, 11) = DMNotes
End If
Next i
  #2  
Old January 8th, 2008, 12:55 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Obtain row number of active cell

Maybe

DBaseRow = ActiveCell.Row
Cells(DBaseRow, 5) = TDMCAD

Mike

"Jive" wrote:

Hi i am having a problem with the following section of code within the larger
peice below it.

DBaseRow = ActiveRow
Cells(DBaseRow, 5) = TDMCAD

The whole code is suppose to decect specific changes in the "DesignManager"
Workbook and update the values in the "ProjectsMaster" Workbook but i am
having problems obtaining the row address to use in the cell adresses to
paste the values.

This will no doubt be a simple answer but i am banging my head on the wall
as you read this in frustration. Thanks in advance.

Application.ScreenUpdating = False
Application.DisplayAlerts = False
DesignManager = ActiveWorkbook.Name
Workbooks.Open Filename:="J:\ProSys\DataBase\Projects Master.xls",
ProjectsMaster = ActiveWorkbook.Name
Windows(DesignManager).Activate

For i = 1 To 1000
If Cells(i, 12) = True Then
ProjectID = Cells(i, 1).Value
DMCAD = Cells(i, 5).Value
DMType = Cells(i, 6).Value
DMNotes = Cells(i, 10).Value
Windows(ProjectsMaster).Activate
Cells.Find(What:=ProjectID, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
DBaseRow = ActiveRow
Cells(DBaseRow, 5) = DMCAD
Cells(DBaseRow, 6) = DMType
Cells(DBaseRow, 11) = DMNotes
End If
Next i

  #3  
Old January 8th, 2008, 01:01 PM posted to microsoft.public.excel.worksheet.functions
Jive
external usenet poster
 
Posts: 27
Default Obtain row number of active cell

Thanks for that, i knew it would be simple.

"Mike H" wrote:

Maybe

DBaseRow = ActiveCell.Row
Cells(DBaseRow, 5) = TDMCAD

Mike

"Jive" wrote:

Hi i am having a problem with the following section of code within the larger
peice below it.

DBaseRow = ActiveRow
Cells(DBaseRow, 5) = TDMCAD

The whole code is suppose to decect specific changes in the "DesignManager"
Workbook and update the values in the "ProjectsMaster" Workbook but i am
having problems obtaining the row address to use in the cell adresses to
paste the values.

This will no doubt be a simple answer but i am banging my head on the wall
as you read this in frustration. Thanks in advance.

Application.ScreenUpdating = False
Application.DisplayAlerts = False
DesignManager = ActiveWorkbook.Name
Workbooks.Open Filename:="J:\ProSys\DataBase\Projects Master.xls",
ProjectsMaster = ActiveWorkbook.Name
Windows(DesignManager).Activate

For i = 1 To 1000
If Cells(i, 12) = True Then
ProjectID = Cells(i, 1).Value
DMCAD = Cells(i, 5).Value
DMType = Cells(i, 6).Value
DMNotes = Cells(i, 10).Value
Windows(ProjectsMaster).Activate
Cells.Find(What:=ProjectID, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
DBaseRow = ActiveRow
Cells(DBaseRow, 5) = DMCAD
Cells(DBaseRow, 6) = DMType
Cells(DBaseRow, 11) = DMNotes
End If
Next i

  #4  
Old January 8th, 2008, 01:05 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Obtain row number of active cell

your welcome

"Jive" wrote:

Thanks for that, i knew it would be simple.

"Mike H" wrote:

Maybe

DBaseRow = ActiveCell.Row
Cells(DBaseRow, 5) = TDMCAD

Mike

"Jive" wrote:

Hi i am having a problem with the following section of code within the larger
peice below it.

DBaseRow = ActiveRow
Cells(DBaseRow, 5) = TDMCAD

The whole code is suppose to decect specific changes in the "DesignManager"
Workbook and update the values in the "ProjectsMaster" Workbook but i am
having problems obtaining the row address to use in the cell adresses to
paste the values.

This will no doubt be a simple answer but i am banging my head on the wall
as you read this in frustration. Thanks in advance.

Application.ScreenUpdating = False
Application.DisplayAlerts = False
DesignManager = ActiveWorkbook.Name
Workbooks.Open Filename:="J:\ProSys\DataBase\Projects Master.xls",
ProjectsMaster = ActiveWorkbook.Name
Windows(DesignManager).Activate

For i = 1 To 1000
If Cells(i, 12) = True Then
ProjectID = Cells(i, 1).Value
DMCAD = Cells(i, 5).Value
DMType = Cells(i, 6).Value
DMNotes = Cells(i, 10).Value
Windows(ProjectsMaster).Activate
Cells.Find(What:=ProjectID, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
DBaseRow = ActiveRow
Cells(DBaseRow, 5) = DMCAD
Cells(DBaseRow, 6) = DMType
Cells(DBaseRow, 11) = DMNotes
End If
Next i

  #5  
Old January 8th, 2008, 01:06 PM posted to microsoft.public.excel.worksheet.functions
papou[_4_]
external usenet poster
 
Posts: 34
Default Obtain row number of active cell

Hello

I would suggest a slight amendment to your code:
'...
Windows(ProjectsMaster).Activate
Dim Rng As Range
With ActiveSheet.Cells
Set Rng = .Find(What:=ProjectID, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False)
If Not Rng Is Nothing Then
Cells(Rng.Row, 5).Value = DMCAD
Cells(Rng.Row, 6).Value = DMType
Cells(Rng.Row, 11).Value = DMNotes
End If
End With
End If
Next i

HTH
Cordially
Pascal


"Jive" a écrit dans le message de news:
...
Hi i am having a problem with the following section of code within the
larger
peice below it.

DBaseRow = ActiveRow
Cells(DBaseRow, 5) = TDMCAD

The whole code is suppose to decect specific changes in the
"DesignManager"
Workbook and update the values in the "ProjectsMaster" Workbook but i am
having problems obtaining the row address to use in the cell adresses to
paste the values.

This will no doubt be a simple answer but i am banging my head on the wall
as you read this in frustration. Thanks in advance.

Application.ScreenUpdating = False
Application.DisplayAlerts = False
DesignManager = ActiveWorkbook.Name
Workbooks.Open Filename:="J:\ProSys\DataBase\Projects Master.xls",
ProjectsMaster = ActiveWorkbook.Name
Windows(DesignManager).Activate

For i = 1 To 1000
If Cells(i, 12) = True Then
ProjectID = Cells(i, 1).Value
DMCAD = Cells(i, 5).Value
DMType = Cells(i, 6).Value
DMNotes = Cells(i, 10).Value
Windows(ProjectsMaster).Activate
Cells.Find(What:=ProjectID, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
DBaseRow = ActiveRow
Cells(DBaseRow, 5) = DMCAD
Cells(DBaseRow, 6) = DMType
Cells(DBaseRow, 11) = DMNotes
End If
Next i



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.