J
jpickering74
I'm new to the whole macro thing (at least when it comes to building one),
and need some help/guidance regarding one that I'm working on for a pet
project of mine. The database that I'm currently working with has about 3500
rows of data with approximately 30 columns. I'm sorting the data by a date
field, then for a particular date, generating new sheets for all unique rows.
I've gotten the sheet creation to work, and I have even gotten the delete
function to work, but not the way I would like to do it. So, here are my two
questions:
1) Is there a way to make the delete function based on a prompted variable?
For example, the field that I want to delete based on is the year field, so I
have 2008, 2009, 2010, 2011 & 2012 in my field. I want to be able to delete
all rows except a particular year, but don’t want to have to have multiple
macros based on the particular year if I don’t have to. Also, as the project
goes forward, subsequent years will be added, while older years will likely
fall out. Is that possible, and if so, how do I do that?
2) I’ve gotten the macro to review my selection data and generate individual
sheets based on the identifier and rename the sheet. However, as the macro
is generating the new sheets and pasting over the data, the data that it is
pasting for me is just the look-up data. Is it possible to have that macro,
as it is generating the new sheets, look up a value in a certain cell and
paste over it a certain range of data from another sheet? For example, the
data range for my new sheet generation is 4 columns in width and I want it to
read the upper most right cell (which would be static for all sheets) and if
it matched one of two values, to copy a range of data OVER the data that it
just pasted in, and if it didn’t match, to copy a second range of data from a
second sheet. (Note: the macro that was used to generate these sheets came
from the Ron de Bruin web page, and I am forever grateful for that page)
I've considered that I may need to have the new sheets generated into a new
workbook, since a select all would likely paste over the database sheets as
well. Any help would be greatly appreciated. Thank you
and need some help/guidance regarding one that I'm working on for a pet
project of mine. The database that I'm currently working with has about 3500
rows of data with approximately 30 columns. I'm sorting the data by a date
field, then for a particular date, generating new sheets for all unique rows.
I've gotten the sheet creation to work, and I have even gotten the delete
function to work, but not the way I would like to do it. So, here are my two
questions:
1) Is there a way to make the delete function based on a prompted variable?
For example, the field that I want to delete based on is the year field, so I
have 2008, 2009, 2010, 2011 & 2012 in my field. I want to be able to delete
all rows except a particular year, but don’t want to have to have multiple
macros based on the particular year if I don’t have to. Also, as the project
goes forward, subsequent years will be added, while older years will likely
fall out. Is that possible, and if so, how do I do that?
2) I’ve gotten the macro to review my selection data and generate individual
sheets based on the identifier and rename the sheet. However, as the macro
is generating the new sheets and pasting over the data, the data that it is
pasting for me is just the look-up data. Is it possible to have that macro,
as it is generating the new sheets, look up a value in a certain cell and
paste over it a certain range of data from another sheet? For example, the
data range for my new sheet generation is 4 columns in width and I want it to
read the upper most right cell (which would be static for all sheets) and if
it matched one of two values, to copy a range of data OVER the data that it
just pasted in, and if it didn’t match, to copy a second range of data from a
second sheet. (Note: the macro that was used to generate these sheets came
from the Ron de Bruin web page, and I am forever grateful for that page)
I've considered that I may need to have the new sheets generated into a new
workbook, since a select all would likely paste over the database sheets as
well. Any help would be greatly appreciated. Thank you