VBA Spreadsheet - What have I done wrong?

Eifty

New Member
Joined
Oct 19, 2015
Messages
3
What am I doing wrong?
10ok5nb.jpg

2j1o4dg.jpg
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You must first select or activate a sheet before you can select anything on it.
That being said, do you even need that select?
 
Upvote 0
You must first select or activate a sheet before you can select anything on it.
That being said, do you even need that select?

THANK YOU SO MUCH! You are amazing. <3 One more thing? See where 'activecell' is '+1' I want that cell number to be copied to a 'emptyrow1' in 'Enrolment Background'? How would I do this?

Worksheets("Students").Activate
ws.Cells(emptyRow, 1).Select
Worksheets("Enrolment Background").Activate
ws1.Cells(emptyRow1, 1).Value = ActiveCell

Does that seem right or am I missing something again?
 
Upvote 0
THANK YOU SO MUCH! You are amazing. <3 One more thing? See where 'activecell' is '+1' I want that cell number to be copied to a 'emptyrow1' in 'Enrolment Background'? How would I do this?

Worksheets("Students").Activate
ws.Cells(emptyRow, 1).Select
Worksheets("Enrolment Background").Activate
ws1.Cells(emptyRow1, 1).Value = ActiveCell

Does that seem right or am I missing something again?

I've done it! :D Thanks anyway! :) it was:

Worksheets("Students").Activate
ws.Cells(emptyRow, 1).Select
Worksheets("Enrolment Background").Activate
ws1.Cells(emptyRow1, 1).Value = ws.Cells(emptyRow, 1).value
 
Upvote 0
As a test, try removing the first three lines, just leaving:
Code:
[COLOR=#333333]ws1.Cells(emptyRow1, 1).Value = ws.Cells(emptyRow, 1).value[/COLOR]

As far as I can see, there's no reason to keep that entire select/activate section.
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,667
Members
449,045
Latest member
Marcus05

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