View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Roopesh1978 Roopesh1978 is offline
external usenet poster
 
Posts: 10
Default Excel Database and Macros

Hi I have started to implement a database in Excel. In Sheet1, I have
several fields including Reference Number, First Name, Surname, Area, and
Visit Date. What I want to do is copy the data into sheet2 by using a macro.

I have been provided the following macro:-

dim i
i =1
do until worksheets("sheet1").cells(i,1)=""
worksheets("sheet2").cells(i,1)=worksheets("sheet1 ").cells(i,1)
i = i + 1
loop

When I run this macro, it only copies the first column from sheet1 into
sheet2.

Does anyone know what I can do to the macro to copy over all the contents of
sheet1 into sheet2?

Also, I wanted to know how I can amend the macro so that when the data is
copied from sheet1 to sheet2 then only the data relating to a specific Area
will be displayed in sheet2, for example, looking at the Area field, sheet2
will show all the visits undertaken in USA.

Finally, i wanted to know how I can amend the macro so that when the data is
copied from sheet1 to sheet2 then only the data relating to the visits
conducted in a specific year are displayed, for example, looking at the Visit
Date field, sheet2 will show all the visits undertaken in 2004.

Any help will be appreciated.

Kind Regards,

Roopesh