Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Enquiry on VB for Excel

Dearest All,
I am new to VBA. So please be patient with me.
I am learning how to write macros. However i am stuck in this area:
Given a set of data (Eg,By Group, By GDP) in Sheet1, I wish to copy 1 group
(Eg.Singapore) and GDP figures into a new worksheet named after Singapore.
What must I do?
Thank you
Lee Coh

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200607/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Enquiry on VB for Excel

uses vlookup . see help in excel.

"dhuto777 via OfficeKB.com" <u24088@uwe wrote in message
news:63464cb93b0d2@uwe...
Dearest All,
I am new to VBA. So please be patient with me.
I am learning how to write macros. However i am stuck in this area:
Given a set of data (Eg,By Group, By GDP) in Sheet1, I wish to copy 1
group
(Eg.Singapore) and GDP figures into a new worksheet named after Singapore.
What must I do?
Thank you
Lee Coh

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Enquiry on VB for Excel

See if this from OTTO MOEHRBACK can helip you
QUOTE
Here is a macro that will do what you want. For this macro to operate
correctly the following conditions must exist:
The active sheet is the sheet that contains your raw data.
The raw data is in Columns A:C as you said.
There must a list of all the sheet names in some column of some sheet in
your file and that list must be named "SheetList".
Note that this macro copies Columns B:C and pastes that data into Column A
of the appropriate sheets.
Sub CopyData()
Dim ShtName As Range
Dim RngColA As Range
Dim i As Range
Dim Dest As Range
Set RngColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
For Each ShtName In Range("SheetList")
With Sheets(ShtName.Value)
Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1)
For Each i In RngColA
If Left(i, Len(ShtName.Value)) = ShtName.Value Then
i.Offset(, 1).Resize(, 2).Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End With
Next ShtName
End Sub

OTTO MOEHRBACK
UNQUOTE
--
Robert


"dhuto777 via OfficeKB.com" wrote:

Dearest All,
I am new to VBA. So please be patient with me.
I am learning how to write macros. However i am stuck in this area:
Given a set of data (Eg,By Group, By GDP) in Sheet1, I wish to copy 1 group
(Eg.Singapore) and GDP figures into a new worksheet named after Singapore.
What must I do?
Thank you
Lee Coh

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200607/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
Enquiry Leng Excel Discussion (Misc queries) 1 November 18th 08 12:58 PM
Enquiry Form Abidan Excel Worksheet Functions 0 August 15th 06 11:35 AM
Urgent enquiry jiang Excel Worksheet Functions 6 August 10th 06 11:46 AM
A formula enquiry; (screenshots included) PhilK Excel Discussion (Misc queries) 3 May 23rd 06 10:38 AM


All times are GMT +1. The time now is 01:37 AM.

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"