Visual Basic Help in Excel - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HotUKDeals, you accept our cookie and privacy policy.
Get the HotUKDeals app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Visual Basic Help in Excel

£0.00 @
Hi, I am trying to set up some code for a macro in Excel, but it keeps rejecting the third line (Range("A3").Select). see script below. can anyone help as this all seems correct to me but excel d… Read More
fireexit Avatar
7y, 5m agoPosted 7 years, 5 months ago
Hi,

I am trying to set up some code for a macro in Excel, but it keeps rejecting the third line (Range("A3").Select). see script below. can anyone help as this all seems correct to me but excel doesn't seem to agree!!!

Thanks!

Application.ScreenUpdating = False
Sheets("Database").Select
Range("A3").Select
Rows("3:3").Select
Selection.Insert Shift:=xlDown
Range("A3").Select
Selection.EntireRow.Insert
Tags:
fireexit Avatar
7y, 5m agoPosted 7 years, 5 months ago
Options

All Comments

(3) Jump to unreadPost a comment
Comments/page:
#1
This has happened to me before but only occasionally what I have tried in the past is change
Range("A3").Select > Sheets("Database").Range("A3").Select
#2
What exactly do you want that code to do, it runs for me but not too sure what are looking to achieve.
#3
Those few lines simply insert 2 rows at row 3.

I would use this code...

Sheets("Database").Select
[3:5].Insert

Not sure why your original code caused an error. Maybe the worksheet or workbook were protected?

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!