Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB Expert!

Join 244,303 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 771 people online right now. Registration is fast and FREE... Join Now!




Excel Database

 
Reply to this topicStart new topic

Excel Database

syncervba
11 Jan, 2009 - 09:26 AM
Post #1

New D.I.C Head
*

Joined: 11 Jan, 2009
Posts: 2



Thanked: 1 times
My Contributions
Hi all,

I'm trying to write a code that will locate information in Sheet 1 and search for that same information in Sheet 2, then pull a different bit of information from Sheet 2 and place it back in Sheet 1. I think I can figure out how to write most of the code, but I'm having trouble figuring out how the code that will select the information in Sheet 1 and find it in Sheet 2.

I've listed below exactly what I think I need to do in order to have the write code written.

-Find Next Empty Cell in Column G, Sheet 1, Workbook 1
-Go to Column D, Misc Sheet 1, Workbook 1
-Select Column D contents and search for same contents in Column F Sheet 1, Workbook 2
-If not found, go back to Sheet 1, Workbook 1 and search for next empty cell in Column G
-If found, go to Column H, Sheet 1, Workbook 2 and copy contents
-Go to Column G, Sheet 1, Workbook 1 and paste contents
-Find Next Empty Cell in Column G
-Repeat until Column A, Sheet 1, Workbook 1 is empty

Many thanks for your help!
K

User is offlineProfile CardPM
+Quote Post


Martyr2
RE: Excel Database
11 Jan, 2009 - 10:13 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 6,656



Thanked: 613 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
One site you will want to keep bookmarked is the one below...

Julian's Excel Macro (VBA) Tips for beginners

That will give you some very common functionality and show you a few functions you may like.

Some special words you will need this include the following...

1) Sheets() to change sheets
2) Range() to select a range of cells
3) A loop to loop through the range (more than likely a while loop)
4) ActiveSheet.Paste to paste contents
5) Possibly "Cells()" to index the cell and its "value" property for comparing the values.

So look these up, put something together and then show us your code and we can further assist.

smile.gif
User is online!Profile CardPM
+Quote Post

syncervba
RE: Excel Database
12 Jan, 2009 - 08:44 AM
Post #3

New D.I.C Head
*

Joined: 11 Jan, 2009
Posts: 2



Thanked: 1 times
My Contributions
Hi Martyr,

I'm making progress on my code (there's probably a simpler way to do what I want) but I'm a bit stick on how to search in Workbook 2 for the contents of the Active Cell found in Workbook 1. If anyone has any advice, I would be very grateful.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 05:50PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month