Copy Rows based on count of last row of another Column

Hi..I found this code on the web and it works great I just need to
find a way to expand it to all the other columns without having to
copy it some 26 times for each new column I want copied..Need help
understanding how to write the code so I can do this once for all my
columns that go all the way to BK

Public Sub filldown()
    Dim LRow As Integer
        LRow = Range("B" & Rows.Count).End(xlUp).Row
        Range("A3").Select
        Selection.AutoFill Destination:=Range("A3:A" & LRow),
Type:=xlFillDefault
        Range("C3").Select
        Selection.AutoFill Destination:=Range("C3:C" & LRow),
Type:=xlFillDefault
End Sub

0
3/19/2012 6:54:59 PM
excel 39879 articles. 2 followers. Follow

1 Replies
1444 Views

Similar Articles

[PageSpeed] 12

On Mar 19, 1:54=A0pm, Thomp <williamth...@gmail.com> wrote:
> Hi..I found this code on the web and it works great I just need to
> find a way to expand it to all the other columns without having to
> copy it some 26 times for each new column I want copied..Need help
> understanding how to write the code so I can do this once for all my
> columns that go all the way to BK
>
> Public Sub filldown()
> =A0 =A0 Dim LRow As Integer
> =A0 =A0 =A0 =A0 LRow =3D Range("B" & Rows.Count).End(xlUp).Row
> =A0 =A0 =A0 =A0 Range("A3").Select
> =A0 =A0 =A0 =A0 Selection.AutoFill Destination:=3DRange("A3:A" & LRow),
> Type:=3DxlFillDefault
> =A0 =A0 =A0 =A0 Range("C3").Select
> =A0 =A0 =A0 =A0 Selection.AutoFill Destination:=3DRange("C3:C" & LRow),
> Type:=3DxlFillDefault
> End Sub

Hey Everyone..Figured it out..thanks anyway..Just needed to change
Range to C3:Bk3 and Autofill to C3:BK
0
3/19/2012 7:27:30 PM
Reply:

Similar Artilces:

Stacked Column Graph
I have data that counts in two separrate ways. How can I put two stacked columns next to each other on the same graph (X is in days, Y1 is # of incidents, Y2 is currently an average of days used for a line above the stacks). Hi Tim, Have a look at the resources referred to by Jon. http://peltiertech.com/Excel/ChartsHowTo/ClusterStack.html Cheers Andy Tim wrote: > I have data that counts in two separrate ways. How can I put two stacked > columns next to each other on the same graph (X is in days, Y1 is # of > incidents, Y2 is currently an average of days used for a line a...

Copy empty cells from one workbook to another
Hello, Sorry for posting 2 times. Date & time in my computer were not correctly set. In addition to what I've written before, here is the code I wrote: Sub Dataacquire() Workbooks.Open "data.xls" Worksheets("sheet1").Range("b1:d19").Copy _ ThisWorkbook.Worksheets("sheet1").Range("b1:d19") ActiveWorkbook.Close SaveChanges:=False End Sub My problem that empty cells are not copied as empty and because of this I get an error messages in other worksheets (like #VALUE). How Can I solve this problem ? Thank you David Cohen ...

Can I convert columns to rows?
I need to convert address information, which is on word and listed vertically, to an excel spreadsheet, and have the information list out horizontally. Is this possible to do? I am familiar with the basics of each program, but using "range,formula,value" options in excel confuses me. Here's an example: (My data in word) Mel's Tire Store, Inc. 300 Culbertson Avenue Worland, WY 82401 (307) 347-3601 Need to copy and paste so data spreads horizontally in Excel, under these colum headings: "Business Name" "Address" "City&qu...

adding and counting Help!! #2
Just to add, I'd like to sort the dates 2004.10.01 to 2004.10.31 whe doing the sum of dollar amount -- alexm99 ----------------------------------------------------------------------- alexm999's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=491 View this thread: http://www.excelforum.com/showthread.php?threadid=27264 alexm999 Wrote: > Just to add, I'd like to sort the dates 2004.10.01 to 2004.10.31 whe > doing the sum of dollar amount. Assuming that dates are true dates... =SUMPRODUCT(--(CodeRange=101),--(AdvertisingRange="TV"),--(TEX...

Excel 2003: How to make transparent columns in Excel chart?
If you create a bar plot froma given dataset you can format the columns by right clicking and choosing the desired options. In the tab that opens there is a slider which is supposed tho set the level of transparency of the column (selceted area). But so far i couldn't find a way how to use this slider. I know that there is an alternative way to get transparent bars by creating a rectangular object formating it and the use copy -> paste. But i wonder what is the slider for if you can't use it? Does anybody know have an idea? Cheers, Thomas ...

Monitor another application CLOSE
I want to make an application who can monitor when another application closes and make some specific actions. Both applications are not related at all. What I thought was basically, put my application in a WAIT state, and periodically see if the other one is still active. I think a better solution would be if Windows could notify me when the other applications closes, sending me some message. Then I would wake only once from WaitForSingleObject, just when the closing occurred. Is there such thing in Windows? If it has a window, you ca...

data sort is not including all columns in sort
I have a list with name, company, address, city.....etc. When I click on data sort (i do check the box to include column headings) and do a sort by say address, it will sometimes exclude a column such as name from the sort. It does not always do this. Is this a glitch? Do I need to highlight the entire list before I sort? Also, sometimes if I just use the Ascending or Descending icon rather that going to data, sort it will only sort that column and not the rest of the data with it. Those are the reasons that I don't trust excel to guess at the range I want sorted. I'll...

can i wrap rows to form multiple rows per row to fit on 1 sheet?
i have a worksheet with very long rows (a to cf). For printing i would like to wrap the rows to fit on a single page, and then seperate each set with a space. I would also like to wrap the headers too, of course. is this possible? Say you're creating 10 columns per new row. So it kind of looks like this: $A$1 $B$1 $C$1 $D$1 $E$1 $F$1 $G$1 $H$1 $I$1 $J$1 $K$1 $L$1 $M$1 $N$1 $O$1 $P$1 $Q$1 $R$1 $S$1 $T$1 $U$1 $V$1 $W$1 $X$1 $Y$1 $Z$1 $AA$1 $AB$1 $AC$1 $AD$1 $AE$1 $AF$1 $AG$1 $AH$1 $AI$1 $AJ$1 $AK$1 $AL$1 $AM$1 $AN$1 $AO$1 $AP$1 $AQ$1 $AR$1 $AS$1 $AT$1 $AU$1 $AV$1 $AW$1 $AX$1 $AY$1 $...

VB.net select column and format
Hi, I am using VB.net 2005 with Excel 2003. I need to select a single column and apply formating to it. Can someone please explain how to do this? Thanks, What sort of formatting do you mean? The basic code would be something like Dim RangeToFormat As Excel.Range Dim WS As Excel.Worksheet RangeToFormat = DirectCast( _ XLApp.Workbooks("Book1.xls"). _ Worksheets.Item("Sheet1"), Excel.Worksheet). _ Range("A1").EntireColumn WS = RangeToFormat.Worksheet RangeToFormat = _ XLApp.Intersect(WS.UsedRange, RangeToFormat) RangeToForma...

how to protect appointed rows or columns to use the mouse and keyboard
hzh, You could include some text in your post. Maybe then we could figure out what you mean by "appointed"?? "To use the mouse and keyboard" makes absolutely no sense whatsoever. Maybe you're a new poster??? If so, take a look here before reposting: http://www.cpearson.com/excel/newposte.htm Most anything that could be asked in the newsgroups has already been answered. Take a look here and you may just find what you're looking for (whatever that is)?? http://tinyurl.com/29pby John "hzh" <hzh62@163.com> wrote in message news:7A2382EE-00E6-4679...

Select a certain number of cells in a row
Hi, I'd like to have the macro to select row 5 to 10 in the active column. May I know what is the VB code to write? Regards, Valerie maybe... dim myRng as range dim myCol as long with activesheet mycol = activecell.Column set myrng = .range(.cells(5,mycol),.cells(10,mycol)) end with myrng.select ======= or with activesheet .cells(5,activecell.column).resize(6).select end with I'm not quite sure why you want to select that range. But for the most part, if you act directly on the range (and avoid .selects), you're code will work faster and be easier to modify. Dolph...

Sell item from one location and ship from another
RMS Store Operations should have the ability to sell an item from one store and have it shipped from a different store or warehouse and report all 'type' sales to Headquarters in order to have inventory updated while keeping the sale at the original sale location. -- Reed/Daum Associates, Inc. Pittsburgh PA ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the sugges...

want to limit worksheet to 1000 rows instead of 65,000
My worksheets only need 1000 rows but the worksheet remains at 65,000+ rows. I have 1 GB or ram and 6 worksheets causes problems. How can I set a default to limit the max number of rows and columns. Thank you All (pre-XL07) worksheets have 65536 rows. That can't be changed. However, unused rows don't take up any memory or disk space, so there's no need to try to limit them. What problems are you having? In article <1C30E096-94AD-4244-A976-FEE04B45912D@microsoft.com>, GeoObject <GeoObject@discussions.microsoft.com> wrote: > My worksheets only need 1000 rows b...

OWA Form based authentication
Hello Newsgroup ! I have a question. Does someone of you know how to access the mailbox of another user when form based authentication is enabled? Without FBA enabled it is servername/exchange/user@doamin.com. I don't know how to access the mailbox directly from the logon page when FBA is enabled. Thank you in advanced Br Markus ...

Dialog based problem in vc6
Hi, I am writing an mfc project in vs6 and I have a problem! When I add radio button to my dialog based application and run the application and press that button my application hang, even when I try to run it in the test mode inside visual studio and press that radio button it stack the all environment why?? It append only if I add a radio button for a regular button its all ok! I install sp-6 but it didn't solve the problem. Thanks "Dave" <dbg@012.net.il> wrote in message news:eq14GyguEHA.3872@TK2MSFTNGP11.phx.gbl... > Hi, > > I am writing an mfc project in ...

Rule based on originators category?
In the contacts list you can add categories to each contact. Is there a mechanism in Outlook 2003 that would allow me to base a rule on a contacts category? In plain English, I'd love a rule that was: Apply this rule after the message arrives with the sender in category xyz ... and so on. With such a mechanism, once I added someone to my contacts with the right category/categories then their mail handling would be fully automated by my rules. As it stands now, I can add them to a distribution list, but I then have to update my rules (no exchange server on my horizons). -- St...

Macro to add name on a cell based on the data
Hello, I am using Excel 2003 and I need help to do a macro. I copy and paste data into a worksheet call "Table" In the worksheet I want to put a specialist name in the column called "Specialist" beside a column called "STATE" the specialist name will be based on what the state is. For example If the state contains "CA" I want the specialist name to be "Anna" or the state of "OR" I again want the specialist name to be "Anna" Now if we get a different state "UT" I want the specialist name to be "...

Column Sum in Footer
Hi, I have created a Tabular report that lists names and weights for different people. I want to create a stand-alone field in the page footer that will display the SUM of all the weights on the report. Can somebody please help me? (I'm using Access 2000 btw) I have tried creating a text box with the Control Source property set as "=Sum(weight)". However, this just produces an error. Thanks in advance. Julie Smith wrote: >Hi, >I have created a Tabular report that lists names and weights for different >people. I want to create a stand-alone field in the page f...

How to group similar column titles together????
I have an excel spreadsheet with 6 column titles as follows: 1st column title = ob1 2nd column title = ob2 3rd column title = ab1 4th column title = ob3 5th column title = ab2 6th column title = ob4 I have about 200 lines of information on each column. I want to run a macro / function on this spreadsheet and my spreadsheet should regroup similar titles together as follows: 1st column title = ob1 2nd column title = ob2 3rd column title = ob3 4th column title = ob4 <blank column> 5th column title = ab1 6th column title = ab2 Can someone think of any way to do this? (A macro ...

A cell copied onto one worksheet from another worksheet does display same formatting.
I have 2 worksheets in my workbook. On worksheet "A" i have a number in red font with black background in cell B1. On worksheet "B" the contents of cell A1 is =A!B1. This copies the value located in cell B1 of worksheet "A" but not the color formatting. How can that get copied as well? Hi A formula has one single job: to return a value into its own cell. No formats, no copying, no dancing, no fun, only that. -- HTH. Best wishes Harald Followup to newsgroup only please "Mark" <mark@lbrgroup.com> skrev i melding news:32B8AA2D-DA1D-4B3F-AF73-9...

copy and paste excel spreadsheet into autocad
My autocad drawing is linked to a excel spreadsheet. For fast updating. But the window displayed in autocad changes if I have more than on excel sheet. As I switch from auotcad to excel is there a way to permently save the excel window display and make another window display and alway keep the window the same as you switch from one software to the other ...

CUSTOMER COUNT
WE WOULD LIKE TO RUN A REPORT FOR CUSTOMER COUNT ON A SINGLE DAY OR A DATE RANGE BY DAY ...

Populate comboboxes based on query
I have a textbox on a form that user will enter a string into and press a button. An example of what they will enter is "BD532313CW". Once they press the button i take the first three numbers (532 in this case) and assign them to a string variable named myString. Next I have 2 combo boxes on a form named cmbAcct and cmbDisp. I have a table named "Swbs" that has three fields in it Swbs.Acct, Swbs.Disp, and Swbs.Num. There are duplicates in all fields. I need to populate cmbDisp with the distinct data in Swbs.Disp where Swbs.Num = myString. Likewise I need to populate c...

Counting consecutive negative value
Hi, I have a column with positive and negative numbers. I need to count the largest number of consecutive negative numbers and don't really know how to do it. Thanks in advance. Wallace "Wallace" wrote: > I have a column with positive and negative numbers. > I need to count the largest number of consecutive > negative numbers and don't really know how to do it. First, do you really want to count "consecutive negative numbers" per se, or do you really want to count "number of consecutive cells with negative numbers"? In the...

counting matches
I have a range in a spreadsheet consisting of 80 columns by 30 rows, I am trying to sort and identify the matches included in that data. i would like to be able to get a result showing the combination of times for 2 same, 3 same, 4 same etc and show the combo's.....any ideas? -- Message posted via http://www.officekb.com Ray, What do you mean by "Show the combo's"? If you only want to get a count of matches in the data, try this. If your data is in A1:CB30, first insert two columns at column A and B, moving your table to C1:CD30, then insert a row at row 1, moving your ...