ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find and transpose adjacent values (https://www.excelbanter.com/excel-programming/437685-find-transpose-adjacent-values.html)

J.W. Aldridge

Find and transpose adjacent values
 
Need code that does the following when run:

List of dates start in a1:a300
In a1: "12/31/09"
Adjacent Names in b1"larry", c1"curly", d1"moe"

Dates in E1:N65 (range name "calendar")

When code is run...

If date in a1 is found in named range, paste & transpose values under
date.
ie. if date in a1 is found in E20,

paste values "larry" in e21
paste values "curly" in e22
paste values "moe" in e23


Norbert[_3_]

Find and transpose adjacent values
 
J.W. Aldridge schrieb:
Need code that does the following when run:

List of dates start in a1:a300
In a1: "12/31/09"
Adjacent Names in b1"larry", c1"curly", d1"moe"

Dates in E1:N65 (range name "calendar")

When code is run...

If date in a1 is found in named range, paste & transpose values under
date.
ie. if date in a1 is found in E20,

paste values "larry" in e21
paste values "curly" in e22
paste values "moe" in e23

try something like this:

Range("A1").select
fo n=1 to 300
if Range("A" & n).value= whatever then
Range("E"& n & ":N" & n).selct
selection.copy
Range("E" & n).select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=
False, Transpose:=True
else
end if
next n


All times are GMT +1. The time now is 03:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com