copy paste from one sheet to another and store row #

cccbzg

Board Regular
Joined
Oct 5, 2014
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hi,
The code below is part of a LONG macro which almost works. As I continue to test it, I find things which worked by chance, rather then from good code. I think that's the problem here.

I want to copy data from the INPUT sheet ("B" i) to the next available row in the DATA ANALYSIS sheet. While that part works, debugging tells me that sometimes I get the row number from the INPUT sheet and sometimes from the DATA ANALYSIS sheet. I would like to save the value of the row used (Pasted to) in the DATA ANALYSIS sheet so that I can write other data to that row later in the program. I've tried a few things, but w/o success.

Many thanks for any help.

Bonnie
'''''''''''''''''''''''''''''''''''''''''''' output a NEW STUDENT entry to DATA ANALYSIS

PROCESS:
Dim NextRow As Range
MsgBox "Process"
With Sheets("DATA ANALYSIS").Select
Set NextRow = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
Newstudentrow = ActiveCell.Row
End With
Sheets("input").Range("b" & i).Copy
NextRow.PasteSpecial Paste:=xlValues, Transpose:=True

Application.CutCopyMode = False
Set NextRow = Nothing

'**1**
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,215,756
Messages
6,126,692
Members
449,330
Latest member
ThatGuyCap

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top