-
Registered User
Assistance with Creating a Specific Macro using VBA code
Afternoon all,
I was wondering if someone could help me generate a Macro to do the following:
I have a sheet with the following characteristics.
Column A, rows 8-15 contain headers
Column A, rows 17-24 contain headers
Column A, rows 26-40 contain headers
Column B to CV, row 6 may or may not contain an "X"
Column B to CV, rows 8-15 & 17-24 & 26-40 may or may not contain the various data
I need a macro which does the following on the press of a button located somewhere on the sheet:
- Generate a .TXT file in the folder C:\Test with the name "Test_YYYY_MM_DD_HH_MM_SS_Full.txt" which uses the system time and date to fill in the values
- In the TXT file the following data should be created:
- For Columns B to CV, row 6
- if this cell contains the value "X" then copy/paste in the TXT File the following data:
- for rows 8-15 of that particular column
- if Column XXX,Row#.value is not blanc
ColumnA,Row#.value directly followed by (no spacing) Column XXX,Row#.value directly followed by a return (or enter)
(whereas XXX is the value of the column which mathes the criteria which verifies if row 6 of that column contains an "X") Add a blanc line (another return (or enter)) else proceed to row 17 for rows 17-24 of that particular column if Column XXX,Row#.value is not blanc ColumnA,Row#.value directly followed by (no spacing) Column XXX,Row#.value directly followed by a return (or enter)
(whereas XXX is the value of the column which mathes the criteria which verifies if row 6 of that column contains an "X") Add a blanc line (another return (or enter)) else proceed to row 26 for rows 26-40 of that particular column if Column XXX,Row#.value is not blanc ColumnA,Row#.value directly followed by (no spacing) Column XXX,Row#.value directly followed by a return (or enter)
(whereas XXX is the value of the column which mathes the criteria which verifies if row 6 of that column contains an "X") Add a blanc line (another return (or enter)) else do nothing else proceed to the next column untill it reaches the last column (CV)
I hope I've explained this in a manner someone can understand and would VERY much appreciate any help which can be given on this.
Many thanks in advance!
Bookmarks