#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vba

Hi,

I am new to VBA. I am trying to create a script to do the following:

1. copy a user defined range (only the cells that contains values)
2. paste only the values and transpose the range to a user defined cell

Thank you for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default vba

Delphine wrote:
Hi,

I am new to VBA. I am trying to create a script to do the following:

1. copy a user defined range (only the cells that contains values)
2. paste only the values and transpose the range to a user defined cell

Thank you for your help.


Hi Delphine,

Not to evade you, but since you are new to VBA I heartily suggest you do
a little experimentation by recording a macro as you perform the steps
above. The code it creates will be specific to your selections, but it
will show you how some things are accomplished in VBA, like selecting a
range and paste | transpose. Often you can modify the code easily to
generalize it.

Do write back if you get stuck!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vba

Hi smartin,

I was able to create the macro for a particular range. However, I need to
copy a different range each time and paste it to different cell each time.

"smartin" wrote:

Delphine wrote:
Hi,

I am new to VBA. I am trying to create a script to do the following:

1. copy a user defined range (only the cells that contains values)
2. paste only the values and transpose the range to a user defined cell

Thank you for your help.


Hi Delphine,

Not to evade you, but since you are new to VBA I heartily suggest you do
a little experimentation by recording a macro as you perform the steps
above. The code it creates will be specific to your selections, but it
will show you how some things are accomplished in VBA, like selecting a
range and paste | transpose. Often you can modify the code easily to
generalize it.

Do write back if you get stuck!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default vba

Ok -- good start! If you could post the macro you have so far, we will
see what we can do.

Delphine wrote:
Hi smartin,

I was able to create the macro for a particular range. However, I need to
copy a different range each time and paste it to different cell each time.

"smartin" wrote:

Delphine wrote:
Hi,

I am new to VBA. I am trying to create a script to do the following:

1. copy a user defined range (only the cells that contains values)
2. paste only the values and transpose the range to a user defined cell

Thank you for your help.

Hi Delphine,

Not to evade you, but since you are new to VBA I heartily suggest you do
a little experimentation by recording a macro as you perform the steps
above. The code it creates will be specific to your selections, but it
will show you how some things are accomplished in VBA, like selecting a
range and paste | transpose. Often you can modify the code easily to
generalize it.

Do write back if you get stuck!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vba

This is my code:

Range("A1:K482").Select
Selection.Copy
Range("M1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

Thank you,
Delphine


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default vba

And how do you know what range to copy and what cell to paste?

Delphine wrote:

This is my code:

Range("A1:K482").Select
Selection.Copy
Range("M1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

Thank you,
Delphine


--

Dave Peterson
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



All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"