Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default vba to move and renaming data within a workbook

Guys,

I have a sheet of data, with many lines, that I want to seperate out onto
individual tabs within the same workbook, and to re-name those tabs.

ie within the master sheet their will be data for Area1, Area2, Area3 etc and
what I need is Sheet1 = Area1 - tab re-named Area1, Sheet2 = Area2 - tab re-
named to Area2 and so on.

Anybody know how to write the code to do this??

Many thanks for any help

Kind Regards

David

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default vba to move and renaming data within a workbook

See this page Ozzie
http://www.rondebruin.nl/copy5.htm

You must use this example
http://www.rondebruin.nl/copy5.htm#all


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ozzie via OfficeKB.com" <u18021@uwe wrote in message news:5bd325a636d6a@uwe...
Guys,

I have a sheet of data, with many lines, that I want to seperate out onto
individual tabs within the same workbook, and to re-name those tabs.

ie within the master sheet their will be data for Area1, Area2, Area3 etc and
what I need is Sheet1 = Area1 - tab re-named Area1, Sheet2 = Area2 - tab re-
named to Area2 and so on.

Anybody know how to write the code to do this??

Many thanks for any help

Kind Regards

David

--
Message posted via http://www.officekb.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default vba to move and renaming data within a workbook

Thanks Ron for your speedy reponse, the attached link works perfectly, and
I'm now using it,

one other thing though, is it possible to say;

insert 4 lines on each new tab and then

move range a1:c2 to d1, then delete columns a:c

I don't want to put any reference to sheet names, as they will change
depending upon the data extract.

Thanks again for your help Ron,

Regards

David





Ron de Bruin wrote:
See this page Ozzie
http://www.rondebruin.nl/copy5.htm

You must use this example
http://www.rondebruin.nl/copy5.htm#all

Guys,

[quoted text clipped - 12 lines]

David


--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default vba to move and renaming data within a workbook

Hi

Try this

Above this line

WSNew.Columns.AutoFit

you can add this two lines

WSNew.Range("A1:C2").Copy WSNew.Range("D1")
WSNew.Columns("A:C").Delete


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ozzie via OfficeKB.com" <u18021@uwe wrote in message news:5bd376cf6668a@uwe...
Thanks Ron for your speedy reponse, the attached link works perfectly, and
I'm now using it,

one other thing though, is it possible to say;

insert 4 lines on each new tab and then

move range a1:c2 to d1, then delete columns a:c

I don't want to put any reference to sheet names, as they will change
depending upon the data extract.

Thanks again for your help Ron,

Regards

David





Ron de Bruin wrote:
See this page Ozzie
http://www.rondebruin.nl/copy5.htm

You must use this example
http://www.rondebruin.nl/copy5.htm#all

Guys,

[quoted text clipped - 12 lines]

David


--
Message posted via http://www.officekb.com



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default vba to move and renaming data within a workbook

Oops

To insert the rows use

WSNew.Range("A1:A4").EntireRow.Insert




--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Hi

Try this

Above this line

WSNew.Columns.AutoFit

you can add this two lines

WSNew.Range("A1:C2").Copy WSNew.Range("D1")
WSNew.Columns("A:C").Delete


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ozzie via OfficeKB.com" <u18021@uwe wrote in message news:5bd376cf6668a@uwe...
Thanks Ron for your speedy reponse, the attached link works perfectly, and
I'm now using it,

one other thing though, is it possible to say;

insert 4 lines on each new tab and then

move range a1:c2 to d1, then delete columns a:c

I don't want to put any reference to sheet names, as they will change
depending upon the data extract.

Thanks again for your help Ron,

Regards

David





Ron de Bruin wrote:
See this page Ozzie
http://www.rondebruin.nl/copy5.htm

You must use this example
http://www.rondebruin.nl/copy5.htm#all

Guys,

[quoted text clipped - 12 lines]

David


--
Message posted via http://www.officekb.com







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default vba to move and renaming data within a workbook

Morning Ron

Cheers for the code, inserting the additional lines and deleting the columns
works fines however the the pasting of the copied cells doesn't seem to work?
any ideas.

Cheers for your help,

David


Ron de Bruin wrote:
Oops

To insert the rows use

WSNew.Range("A1:A4").EntireRow.Insert

Hi

[quoted text clipped - 38 lines]

David


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200602/1
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default vba to move and renaming data within a workbook

Hi Ozzie

Do you want to copy the cells from ws1 to the sheets?


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ozzie via OfficeKB.com" <u18021@uwe wrote in message news:5bdc2249a6372@uwe...
Morning Ron

Cheers for the code, inserting the additional lines and deleting the columns
works fines however the the pasting of the copied cells doesn't seem to work?
any ideas.

Cheers for your help,

David


Ron de Bruin wrote:
Oops

To insert the rows use

WSNew.Range("A1:A4").EntireRow.Insert

Hi

[quoted text clipped - 38 lines]

David


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200602/1



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default vba to move and renaming data within a workbook

Hi Ron,

No, I need to copy the cells from each sheet, and paste them into D1 before
we delete columns A:C

WSNew.Range("A1:C2").Copy WSNew.Range("D1")

I tried adding the paste function by the line of code above, but can't seem
to do it?

Thanks for your help,



Ron de Bruin wrote:
Hi Ozzie

Do you want to copy the cells from ws1 to the sheets?

Morning Ron

[quoted text clipped - 17 lines]

David


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200602/1
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default vba to move and renaming data within a workbook

It is working for me

Why do you copy two rows to D1 before you delete Column A:C
WSNew.Range("A1:C2")



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ozzie via OfficeKB.com" <u18021@uwe wrote in message news:5be8a166d0ba9@uwe...
Hi Ron,

No, I need to copy the cells from each sheet, and paste them into D1 before
we delete columns A:C

WSNew.Range("A1:C2").Copy WSNew.Range("D1")

I tried adding the paste function by the line of code above, but can't seem
to do it?

Thanks for your help,



Ron de Bruin wrote:
Hi Ozzie

Do you want to copy the cells from ws1 to the sheets?

Morning Ron

[quoted text clipped - 17 lines]

David


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200602/1



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default vba to move and renaming data within a workbook

Ron,

My mistake, my spreadsheet was out by a few lines which is why it was copying
and pasting blank cells!. I amended this and it now works fine, as you said
it would.

Many thanks for all your help,

Cheers,

David


Ron de Bruin wrote:
It is working for me

Why do you copy two rows to D1 before you delete Column A:C
WSNew.Range("A1:C2")

Hi Ron,

[quoted text clipped - 17 lines]

David


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200602/1
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Move data within workbook gregatvrm Excel Discussion (Misc queries) 2 August 27th 07 06:50 PM
automatically move cell data in 1 workbook to another workbook Genesis Excel Worksheet Functions 1 November 5th 06 07:35 PM
Move some data to new workbook - my attempted macro is no good marlea[_8_] Excel Programming 3 November 9th 05 09:46 PM
can I move data from workbook A to B using a conditional formula Bonnie Excel Worksheet Functions 2 April 14th 05 09:28 PM
Workbook renaming billyb Excel Programming 3 May 31st 04 04:05 PM


All times are GMT +1. The time now is 08:33 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"