Auto Highlight Code

  • Thread starter Thread starter joelbeveridge
  • Start date Start date
J

joelbeveridge

Hey Crew.

I made a really sexy macro with the Help of Dave (forum person). Now
this macro saves my information to .csv format, But what im looking for
is the code which i can add to this macro that will only select the
cells i wish. e.g. cell "N11 down to "W35".

So anyone know any auto select code??? Spanks for your help
 
Range("N11:W35).Select

Note: you rarely have to use select.

Instead of

Dim actSht As Worksheet
Set actSht = ActiveSheet
Worksheets("Sheet2").Activate
Range("A1:J10").Select
Selection.Copy
actSht.Activate
Range("K43").Select
ActiveSheet.Paste

use

Worksheets("Sheet2").Range("A1:J10").Copy _
Destination:=ActiveSheet.Range("K43")

or, if you just want to copy values:

Range("K43").Resize(10, 10).Value = _
Worksheets("Sheet2").Range("A1:J10").Value

which bypasses using the Clipboard (and is analogous to Paste
Special/Values)


Gord Dibben MS Excel MVP
 
Check your other thread.
Hey Crew.

I made a really sexy macro with the Help of Dave (forum person). Now
this macro saves my information to .csv format, But what im looking for
is the code which i can add to this macro that will only select the
cells i wish. e.g. cell "N11 down to "W35".

So anyone know any auto select code??? Spanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top