I don't know, but I came across a list of "Last surviving United States war veterans" on Wikipedia. At least five and probably more --but a 12-year old drummer boy in 1865 would be 87 in 1940. I did come across a GAR veteran's grave in New York once, near my grandparents grave. That cemetery opened about 1927, the year my grandmother died, and the grave was near my folks grave.
According to Paul L. Roy, who coordinated the 1938 Last Reunion of the Blue and Gray at Gettysburg, invitations were "sent out to 15,000 Veterans in every state in the Union, the District of Columbia, Canada and three foreign countries." He notes that while the number of Union veterans was well documented in Federal records, there were many Confederate veterans they did not know about, who did not receive invitations. Some 2,000 actually attended. [55,000 had attended the 1913 reunion.]
Attrition in the folowing years rose very rapidly (most men were in their 90s)
In 1940, GAR membership was 1,039; by 1949 that had dropped to 16. At its height, in the 1890s, about 40% of Union veterans belonged to the GAR, that percentage was much smaller as the 20th century progressed. see: GAR
I would estimate the total number of ACW veterans living in 1940 to be 4,000-6,000.
The 1940 census, I believe, had a column for "Veterans," where the war in which they served was to be noted (I know the 1930 census did). I don't know how carefully it was recorded, but documents regarding that census should note how many were marked "CW."