MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 23rd, 2002, 11:56 PM   #1
vac
Board Regular
 
Join Date: May 2002
Posts: 211
Default

I'm refrasing my origional question here, but it may help.
I want to extact the data form a worksheet lets say cells B3, C4,D5, and place this data in another worksheet in the next available row.
I'm sure this can be done, can anyone help please
vac is offline   Reply With Quote
Old May 24th, 2002, 02:08 AM   #2
Colo
MrExcel MVP
 
Colo's Avatar
 
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
Default

Hi vak,

Please copy this into a standard module, and try this.


Sub test()
Dim sh1 As Worksheet, sh2 As Worksheet, i As Integer
'///You will need to modify the sheet name
Set sh1 = Sheets("Sheet1") ' Name of Data Sheet
Set sh2 = Sheets("Sheet2") 'Name of Another Sheet
With sh1
For i = 2 To 4
sh2.Cells(Rows.Count, i).End(xlUp).Offset(1).Value = .Cells(i + 1, i).Value
Next
End With
Set sh1 = Nothing: Set sh2 = Nothing
End Sub

__________________
Regards,

Masaru Kaji aka Colo - Ex Microsoft MVP Since 2004 -2009
Colo is offline   Reply With Quote
Old May 24th, 2002, 10:00 AM   #3
vac
Board Regular
 
Join Date: May 2002
Posts: 211
Default

Many thanks Colo,
It works perfect.
How do I change the code to make it pick out the data from different cells, I think the cells I need the info from are D8, C1, B24, thanks again
vac is offline   Reply With Quote
Old May 25th, 2002, 04:35 AM   #4
Colo
MrExcel MVP
 
Colo's Avatar
 
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
Default

Hi vac,

An easy one is...


Sub test2()
'///You will need to modify the sheet name
Sheets("Sheet2").[B65536].End(xlUp).Offset(1).Value = Sheets("Sheet1").[B24].Value
Sheets("Sheet2").[C65536].End(xlUp).Offset(1).Value = Sheets("Sheet1").[C1].Value
Sheets("Sheet2").[D65536].End(xlUp).Offset(1).Value = Sheets("Sheet1").[D8].Value
End Sub


__________________
Regards,

Masaru Kaji aka Colo - Ex Microsoft MVP Since 2004 -2009
Colo is offline   Reply With Quote
Old May 25th, 2002, 08:08 AM   #5
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

You can do this with the indirect function perhaps? Take a look at this it may give you some ideas:

Microsoft Excel - RHOD1.xls______________Running: xl2000 : OS = Windows (32-bit) 4.10
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
A1=LIAB COLUMN BREAKDOWN

A
B
C
D
E
1
LIAB COLUMN BREAKDOWN



2





3
File descriptionIndexFile path

4
Form 51 results including new cost of bonus.1C:WINDOWSDesktopExcel stuff[TESTFILE.xls]

5
Cost of Terminal Bonus for Form 582C:WINDOWSDesktopExcel stuff[TESTFILE.xls]

6

3


7

4


8





9
NameFileSheetRangeValue
10
DATA1Sheet1A1:A20:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B10-1,0)&C10&%22%27!%22&D10))")>59994
11

2Sheet1A4:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B11-1,0)&C11&%22%27!%22&D11))")>437
12

1Sheet2A5:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B12-1,0)&C12&%22%27!%22&D12))")>1135
13

1Sheet1B1:B10:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B13-1,0)&C13&%22%27!%22&D13))")>5646
14

2Sheet2A3:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B14-1,0)&C14&%22%27!%22&D14))")>645
15
OBASS_NPWPRP1Sheet1B5:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B15-1,0)&C15&%22%27!%22&D15))")>23
16

2Sheet1B2:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B16-1,0)&C16&%22%27!%22&D16))")>253
17

2Sheet1B1:B10:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B17-1,0)&C17&%22%27!%22&D17))")>5646
18

2Sheet1B3:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B18-1,0)&C18&%22%27!%22&D18))")>2
19

2Sheet1B6:alert("=SUM(INDIRECT(%22%27%22&OFFSET($C$4,B19-1,0)&C19&%22%27!%22&D19))")>34
Liab

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by[HtmlMaker V1.25]
If you want this code, click here and Colo will email the file to you
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo


Note: To read in the values the file links must be open.

RET79
RET79 is offline   Reply With Quote
Old May 25th, 2002, 12:28 PM   #6
vac
Board Regular
 
Join Date: May 2002
Posts: 211
Default

Many thanks ret79, colo's example works perfect
Vac
vac is offline   Reply With Quote
Old May 25th, 2002, 12:29 PM   #7
vac
Board Regular
 
Join Date: May 2002
Posts: 211
Default

Colo your a genius! it works perfect
I'm in your debt
Vac
vac is offline   Reply With Quote
Old May 25th, 2002, 04:58 PM   #8
Colo
MrExcel MVP
 
Colo's Avatar
 
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
Default

Hi vac, You are welcom

Hi RET79,
Nice answer!

About HtmlMaker
Java Script is used to show formulas, a message box is not started
when the characters ['] or ["] are inputted into one cell.

But we can see the formula on the status bar when mouse is on hyperlinks.

And new version is
click here to download
__________________
Regards,

Masaru Kaji aka Colo - Ex Microsoft MVP Since 2004 -2009
Colo is offline   Reply With Quote
Old May 26th, 2002, 11:29 PM   #9
Colo
MrExcel MVP
 
Colo's Avatar
 
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
Default

Hi RET79,
The latest version was updated.(Not beta version)

When the characters ['] or ["] are inputted into one cell, it is no problem.

Microsoft Excel - Book1___Running: xl97 : OS = Windows (32-bit) 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
=

A
B
C
D
E
1
LIAB COLUMN BREAKDOWN



2





3
File descriptionIndexFile path

4
Form 51 results including new cost of bonus.1C:WINDOWSDesktopExcel stuff[TESTFILE.xls]

5
Cost of Terminal Bonus for Form 582C:WINDOWSDesktopExcel stuff[TESTFILE.xls]

6

3


7

4


8





9
NameFileSheetRangeValue
10
DATA1Sheet1A1:A2059994
11

2Sheet1A4437
12

1Sheet2A51135
13

1Sheet1B1:B105646
14

2Sheet2A3645
15
OBASS_NPWPRP1Sheet1B523
16

2Sheet1B2253
17

2Sheet1B1:B105646
18

2Sheet1B32
19

2Sheet1B634
Sheet1

To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

The above image was automatically generated by [HtmlMaker 2.0] If you want this FREE SOFT, click here to download
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo

__________________
Regards,

Masaru Kaji aka Colo - Ex Microsoft MVP Since 2004 -2009
Colo is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:56 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes