Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Going to a cell in column B

I use VBA to copy data from a row on 'Post' to the next blank row on
'Charging'.
What can I add to my code to:
A) open 'Charging' on screen and then
B) get cell B on the row which has just been copied to 'Charging' to have
focus?

Code below:
Sub Charge()

If ActiveCell.Value = "CH" Then
RowNo = ActiveCell.Row
With Sheets("Charging")
Lastrow = .Range("B" & Rows.Count).End(xlUp).Row
Newrow = Lastrow + 1
End With
Sheets("Charging").Range("B" & Newrow).Value = _
Sheets("Post").Range("B" & RowNo)
Sheets("Charging").Range("C" & Newrow).Value = _
Sheets("Post").Range("E" & RowNo)
etc. etc.
End If
End Sub
--
Traa Dy Liooar

Jock
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Going to a cell in column B

Application.Goto Reference:=Worksheets("Charging").Range("B" & Newrow)
--
Gary''s Student - gsnu200823


"Jock" wrote:

I use VBA to copy data from a row on 'Post' to the next blank row on
'Charging'.
What can I add to my code to:
A) open 'Charging' on screen and then
B) get cell B on the row which has just been copied to 'Charging' to have
focus?

Code below:
Sub Charge()

If ActiveCell.Value = "CH" Then
RowNo = ActiveCell.Row
With Sheets("Charging")
Lastrow = .Range("B" & Rows.Count).End(xlUp).Row
Newrow = Lastrow + 1
End With
Sheets("Charging").Range("B" & Newrow).Value = _
Sheets("Post").Range("B" & RowNo)
Sheets("Charging").Range("C" & Newrow).Value = _
Sheets("Post").Range("E" & RowNo)
etc. etc.
End If
End Sub
--
Traa Dy Liooar

Jock

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Going to a cell in column B

Nice one, thanks.
--
Traa Dy Liooar

Jock


"Gary''s Student" wrote:

Application.Goto Reference:=Worksheets("Charging").Range("B" & Newrow)
--
Gary''s Student - gsnu200823


"Jock" wrote:

I use VBA to copy data from a row on 'Post' to the next blank row on
'Charging'.
What can I add to my code to:
A) open 'Charging' on screen and then
B) get cell B on the row which has just been copied to 'Charging' to have
focus?

Code below:
Sub Charge()

If ActiveCell.Value = "CH" Then
RowNo = ActiveCell.Row
With Sheets("Charging")
Lastrow = .Range("B" & Rows.Count).End(xlUp).Row
Newrow = Lastrow + 1
End With
Sheets("Charging").Range("B" & Newrow).Value = _
Sheets("Post").Range("B" & RowNo)
Sheets("Charging").Range("C" & Newrow).Value = _
Sheets("Post").Range("E" & RowNo)
etc. etc.
End If
End Sub
--
Traa Dy Liooar

Jock

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Going to a cell in column B

On Jan 5, 4:11*pm, Gary''s Student
wrote:
Application.Goto Reference:=Worksheets("Charging").Range("B" & Newrow)
--
Gary''s Student - gsnu200823



"Jock" wrote:
I use VBA to copy data from a row on 'Post' to the next blank row on
'Charging'.
What can I add to my code to:
A) open 'Charging' on screen and then
B) get cell B on the row which has just been copied to 'Charging' to have
focus?


Code below:
Sub Charge()


If ActiveCell.Value = "CH" Then
* *RowNo = ActiveCell.Row
* *With Sheets("Charging")
* * * Lastrow = .Range("B" & Rows.Count).End(xlUp).Row
* * * Newrow = Lastrow + 1
* *End With
* *Sheets("Charging").Range("B" & Newrow).Value = _
* * * Sheets("Post").Range("B" & RowNo)
* *Sheets("Charging").Range("C" & Newrow).Value = _
* * * Sheets("Post").Range("E" & RowNo)
etc. etc.
End If
End Sub
--
Traa Dy Liooar


Jock- Hide quoted text -


- Show quoted text -


Or try
Worksheets("Charging").Range("B" & Newrow).activate
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Going to a cell in column B

Many way to skin a cat etc, but what are the pitfalls/advantages?
--
Traa Dy Liooar

Jock


" wrote:

On Jan 5, 4:11 pm, Gary''s Student
wrote:
Application.Goto Reference:=Worksheets("Charging").Range("B" & Newrow)
--
Gary''s Student - gsnu200823



"Jock" wrote:
I use VBA to copy data from a row on 'Post' to the next blank row on
'Charging'.
What can I add to my code to:
A) open 'Charging' on screen and then
B) get cell B on the row which has just been copied to 'Charging' to have
focus?


Code below:
Sub Charge()


If ActiveCell.Value = "CH" Then
RowNo = ActiveCell.Row
With Sheets("Charging")
Lastrow = .Range("B" & Rows.Count).End(xlUp).Row
Newrow = Lastrow + 1
End With
Sheets("Charging").Range("B" & Newrow).Value = _
Sheets("Post").Range("B" & RowNo)
Sheets("Charging").Range("C" & Newrow).Value = _
Sheets("Post").Range("E" & RowNo)
etc. etc.
End If
End Sub
--
Traa Dy Liooar


Jock- Hide quoted text -


- Show quoted text -


Or try
Worksheets("Charging").Range("B" & Newrow).activate



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches [email protected] Excel Worksheet Functions 66 May 1st 23 03:44 AM
Sum Cell Values of one column based on Another Cell Value in a different column kristenb via OfficeKB.com Excel Worksheet Functions 5 April 26th 23 07:41 PM
compare cells in column to criteria, then average next column cell Bradwin Excel Worksheet Functions 2 July 21st 08 08:37 PM
how to select a single column when this column cross a merged cell cnEagle Excel Programming 1 November 13th 07 04:49 AM
Format cell in column B based on value in the next cell (column c) Nicole Excel Discussion (Misc queries) 7 May 18th 05 10:19 PM


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