Still need help on Macro

If you would look at my post down below, it's titled Need Macro Help please.
0
Utf
11/19/2009 2:05:02 PM
excel.programming 6508 articles. 2 followers. Follow

3 Replies
770 Views

Similar Articles

[PageSpeed] 55

You should stay in the ORIGINAL thread and have a bit of patience. Or,

      If desired, send your file to my address below. I will only look if:
      1. You send a copy of this message on an inserted sheet
      2. You give me the newsgroup and the subject line
      3. You send a clear explanation of what you want
      4. You send before/after examples and expected results.


-- 
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
"MWhaley" <MWhaley@discussions.microsoft.com> wrote in message 
news:22ED2E4B-3AF5-494A-86EF-E296F621C373@microsoft.com...
> If you would look at my post down below, it's titled Need Macro Help 
> please. 

0
Don
11/19/2009 2:24:27 PM
Try these changes.  It will automatically add sheet1 and sheet2 into the 
PALLET workbooks

Sub test()

Folder = "H:\Inventory Control\HDD SCRAP\HDD SCRAP FOLDER  2009\" & _
   "Shipped Pallets\2nd Qtr\"

Set HardDrivebk = Workbooks("Hard Drive test.xls")

FName = Dir(Folder & "*.xls")
Do While FName <> ""
   Set bk = Workbooks.Open(Filename:=Folder & FName)

   With bk
      'add sheet 1 and sheet 2 to bk
      Set NewSht1 = .Sheets.Add(before:=Sheets(1))
      NewSht1.Name = "Sheet1"
      Set NewSht2 = .Sheets.Add(after:=Sheets(1))
      NewSht2.Name = "Sheet2"
      
      .Sheets("W.Digital Pallet 5").Select
      Application.Run "'Hard Drive test.xls'!Macro3"
      
      With bk.Sheets("Sheet1")
         LastRow = .Range("A" & Rows.Count).End(xlUp).Row
         Set CopyRange = .Range("A1:D" & LastRow)
      End With
      
      With HardDrivebk.Sheets("Sheet1")
         LastRow = .Range("A" & Rows.Count).End(xlUp).Row
         NewRow = LastRow + 1
         CopyRange.Copy Destination:=.Range("A" & NewRow)
      End With
      .Close savechanges:=False
   End With
   FName = Dir()
Loop
End Sub



"MWhaley" wrote:

> If you would look at my post down below, it's titled Need Macro Help please.
0
Utf
11/19/2009 3:02:03 PM
That works great, Thanks Joel

"Joel" wrote:

> 
> Try these changes.  It will automatically add sheet1 and sheet2 into the 
> PALLET workbooks
> 
> Sub test()
> 
> Folder = "H:\Inventory Control\HDD SCRAP\HDD SCRAP FOLDER  2009\" & _
>    "Shipped Pallets\2nd Qtr\"
> 
> Set HardDrivebk = Workbooks("Hard Drive test.xls")
> 
> FName = Dir(Folder & "*.xls")
> Do While FName <> ""
>    Set bk = Workbooks.Open(Filename:=Folder & FName)
> 
>    With bk
>       'add sheet 1 and sheet 2 to bk
>       Set NewSht1 = .Sheets.Add(before:=Sheets(1))
>       NewSht1.Name = "Sheet1"
>       Set NewSht2 = .Sheets.Add(after:=Sheets(1))
>       NewSht2.Name = "Sheet2"
>       
>       .Sheets("W.Digital Pallet 5").Select
>       Application.Run "'Hard Drive test.xls'!Macro3"
>       
>       With bk.Sheets("Sheet1")
>          LastRow = .Range("A" & Rows.Count).End(xlUp).Row
>          Set CopyRange = .Range("A1:D" & LastRow)
>       End With
>       
>       With HardDrivebk.Sheets("Sheet1")
>          LastRow = .Range("A" & Rows.Count).End(xlUp).Row
>          NewRow = LastRow + 1
>          CopyRange.Copy Destination:=.Range("A" & NewRow)
>       End With
>       .Close savechanges:=False
>    End With
>    FName = Dir()
> Loop
> End Sub
> 
> 
> 
> "MWhaley" wrote:
> 
> > If you would look at my post down below, it's titled Need Macro Help please.
0
Utf
11/19/2009 3:46:02 PM
Reply:

Similar Artilces:

Help
My organization has 4 entities with 4 domain names. I have created 4 recipient policies to assign the domain email address to users of each entity (1 email per user). However, there are certain users that need to have an email address other than the primary address that they receive. Without manually assiging this address, can I create a group, put users in that group, and have a recipient policy assign all necessary addresses based on this group membership? -- Richard Perry Systems Administrator/Programmer Shadow Mountain Ministries San Diego Christian College Southern California Semin...

combo box and subform help
In my subform for each seperate order, I want to beable to select a descripton name from the combo box. When the description name is selected, the price associated with that name should come up in the subform. I have tried to put the combo box in the table for description and make a query but, the information associated with the description name will not come up. Create the combo box cboItem with the RowSource something like: SELECT tblItem.ItemKey, tblItem.ItemDescription, tblItem.SellPrice FROM tblItem; Set the number of columns to 3 Set the column widths to 0;2;0 or something e...

urgent help to find out why
Hi all, windows 2003 /exchange 2003 SP2 with FE and BE Users are complaining that they do not receive messages timely. I check the BE's queues and find out over 5000 mesages in the local delivery queue about the 1.7 GB size(no limit set up here and is not allowed to do it. If I do a search, I can not find out the messages which have large sizes. What's the log to track own who send large attachment? tracking log. Also, any other ways to make queue go down quickly? To rebboot the server? Can we set up the alert if messages queued up in the local delivery queue? O...

CRM3.0 needs to support single Exchange 2007
Microsoft CRM needs to support Exchange 2007 without the need to have an Exchange 2000/2003 server deployed. It is not acceptable for customers to wait and be expected to wait to CRm4.0 is released then upgrade to this CRM version. ---------------- 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 suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the me...

Problems creating a PDF file from a report using autoexec macro
Hi, I am using the autoexec macro to run a report and print it out as a pdf file. My steps in the autoexec macro are 1. OpenReport 2. Print Out 3. RunCode 4. Quit. The RunCode is designed to delay the closing of the application by two minutes so that the pdf file can be created. Whenever I run this, I get a box that comes up and says "Print Macro Definitions" Include for Macro _Properties _Actions and Arguments _Permissions by User and Group. The application hangs on this without closing. Can someone tell me what I am doing wrong? Is Print Out the right command? Tha...

Lifetime Planner still has loan payments after loan ends
I have a home loan that Lifetime Planner still has loan payments after loan ends in the forecast "what expenses will I have" screen. If I show "when will my loans be paid off" it shows it correctly paid in the correct year 2037. Stranger still is that say my payment is 1300 which includes 250 prop tax and 50 ins. I thougth well yes you would still have to pay the 300 a month even after you pay off the loan right. But the load amount after payoff for 2037 is 1400 a year so that isnt right either. ...

Replicating Chart Apperance with Macro
Hi. I've written a macro to help me at work. Basically it mass produces charts and pastes them into Word. The problem I'm having is that I can't exactly replicate the manually created chart apperance - mainly due to the resizing that is need to insert the document into word (legend and chart area size). If you have any tips or advice it would be most appreciated. Thanks for your help. Bryan Bryan - You should record macros for all the pieces of your procedure. Somewhere you must resize the chart manually: see what the syntax and sizes are in the recorded code. Record w...

Macro to look up values in 2 different columns
Hi, I need a macro which compares the values in colA and colC of sheet 1 to column D and column E of sheet 2, if both the value match, then it copies the contents from sheet2 col F,G and H into sheet1 colC,D and F. Please advise. Thanks Sub CompareThis() For iRow = 1 to 1000 If Sheets("Sheet1").cells(iRow, 1).Value = Sheets("Sheet2").cells (iRow, 4).Value And _ Sheets("Sheet1").cells(iRow, 3).Value = Sheets("Sheet2").cells(iRow, 5).Value Then Sheets("Sheet1").cells(iRow, 3).Value = Sheets("Sheet2").cells(iRow, ...

Macro Button Question
Heya All, I am trying to insert and delete rows using macros. Ive assigned the Macro to a button, but would like to be able to insert (and delete) exactly where the button is on the worksheet, no matter where the activecell is.. So, I guess my question is, is it possible to get the cell reference behind a graphic button? Or, even better, assign a macro to a cell? ta, Maria Maria There are "insert row" and "insert column" buttons available from Tools>Customize>Commands>Insert Also "delete row" and "delete column" buttons available from To...

Help with graph
Hello, I am having trouble representing this data in a graph Column A = 17 Items Column B = September Reported Column C = September Actual Column D = October Reported Column E = October Actual .... to the end of the year I want to show each item with the numbers reported in contrast to the acutal. I can't get it into a format that is easily represented in a graph. Am I arranging my data incorrectly? What kind of graph should I use? Hi, You could create a (say Bar) chart from your data by selecting B1 and D1 (select B1, CTRL-click D1) and Insert Chart. On the Series tab, add a Series...

FRX help #2
I was wondering if there was any way to run a report in Frx by vendor name. So if I wanted to see what I paid ABC Company for the month by G/L code, it would show me. If so, how would you do it. Any help would be appreciated thanks Barb Can get everything except the GL code through a smart list : Payables Transactions Search Doc type = payment Doc Date between... Vendor ID = But getting to the GL account is beyond me (newbie) "BK" wrote: > I was wondering if there was any way to run a report in Frx by vendor name. > So if I wanted to see what I paid ABC Company for the...

Find byte pattern in file (still desperate for solution)
I'm still desperately looking for a solution to this question. I need a very intelligent way to find an array of bytes within a file, but not only that preferably a regex expression of sorts. For example my database has around 50,000 regex entries such as "FFFF.*BB0403.*FF" that I want to turn into a byte array then search for. I understand how to go about writing my own code for this, however it is a little over my head when we're dealing with searching so many patterns against many files while trying to be speedy about the operation. Does anyone have any g...

HELP!!! Nothings happening....
I have installed MS CRM 1.2 and everything apparently went fine but nothing happens. I cant get the website open or connect via Outlook... you really need to be more specific............. in the browser when you try to access CRM, what exactly happens? Is it just closing? Do you get any error message? If its the latter, try disabling all pop up blockers............ -Gary "Michael" <dont@spam.me> wrote in message news:qe5ec056hbaanuum3vdefjjmak8ck8vrig@4ax.com... > I have installed MS CRM 1.2 and everything apparently went fine but > nothing happens. I cant get the we...

Formula Help 03-02-10
HI, worksheet formulas are not one of my best, so I need a little help once again from the forum. Here is a if formula that I started with, but it does not suit my needs, I also looked at or ways beside the If. IF(AH10>=1,(BB1=" ")) What I' trying to do is say the if AH10 >=1 then I want cell BB1 to be blank. I need the formula to be in cell BB2. Thanks for any help. On Mar 2, 3:29=A0pm, Charles <harm.char...@gmail.com> wrote: > HI, worksheet formulas are not one of my best, so I need a little help > once again from the forum. > Here is a if...

Data Migration Error
Hi All, Im having trouble importing email activites into MS CRM. When running the migration tool , Im getting the following error in the logs for every email I've set up as an activity. I've checked the guids for the owninguser and the objectid (contact), and they all exist. Im not creating any associated records in the cdf_ActivityParty table, as I only want to store the link for the "regarding" item so to speak. Thoughts anyone? - Its my last issue to resolve before I can put this out to production. Regards, Cameron 21/10/2004 - 8:43:18 AM -- [ERROR] Failed to...

Restoring Prod Database to New Server/Domain
I have a client who has quite a bit of data to import into CRM 4.0, however they are using a hosted solution and I will not have access to the database, web services, plugins, code, scribe. etc. The hosting company will however allow us to provide them a database to restore. I have an environment I can use for this effort. The hosting company warns us that this hasn't gone so well. What is your opinion on restoring the DB to their environment? Are there any known issues, problems that would cause you to suggest another method? Thanks! sounds ok to me - not too sure what the hosting c...

Update Query Needed 04-12-07
Hello everyone... I have column of prefixes that I need to append numbers too... My column currently looks like this... 787-222 787-221 787-721 I need to make it look like this... 787-222=787 787-221=787 787-721=787 The table name is LocalFaxPrefixes How do you add the "=787" to the end of each line in that Cell without having to do it manually? I Know how to paste an SQL View to a query, I just don't know how to write it from scratch. Thanks in advance for your help. Dale On Thu, 12 Apr 2007 11:57:27 -0400, Bikini Browser wrote: > Hello everyone......

Need to add cell comments in unlocked cell on protected worksheet
Using Excel 2002, I have a worksheet that I have "protected" so that only a certain block of cells can be selected/edited. Today, I have a new requirement to be able to add/edit/delete cell comments on those cells that remain unlocked. But the options to do so on the cell context menu disappear when the worksheet is protected, but reappear when the worksheet is unprotected. When you protect the worksheet, scroll down and check "edit objects". This will allow comments to be added/removed/changed--along with other objects (pictures/shapes/etc). dan400man wrote: >...

Excel Macro Clipboard Problem
I am trying to copy data from a web page table to an Excel worksheet using a macro. I am doing this be opening the html file, copying the data, and closing the html file. When I close it, I am asked if I want to keep the clipboard contents (I do not). I have to select No manually while the macro runs. How can prevent this? Application.DisplayAlerts = false -- HTH - -Frank Isaacs Dolphin Technology Corp. http://vbapro.com "Glenn H" <hall_glenn@hotmail.com> wrote in message news:00c701c3c978$cc7a2000$a301280a@phx.gbl... > I am trying to copy data from a web page tabl...

Eliminate macro warning when you open a workbook
I have a shared workbook that everytime someone opens it the macro warning comes up. I cannot find a macro in the workbook and wish to prevent the pop up box. Karlene Check out this link to explain what's happening and how to stop it: http://www.contextures.com/xlfaqMac.html#NoMacros Hope this helps. Pete On Jan 13, 4:35=A0pm, Karlene <Karl...@discussions.microsoft.com> wrote: > I have a shared workbook that everytime someone opens it the macro warnin= g > comes up. =A0I cannot find a macro in the workbook and wish to prevent th= e pop > up box. &...

Personal Macro Workbook 05-12-10
I am trying to simply record a macro to my personal workbook so I can use it in various files/workbooks. I keep getting the error message that "The Personal Marco Workbook needs to remain Open when recording mactos to the Personal Macro Workbook". How do I ensure that my Personal Macro Workbook remains OPEN at all times???? ...

how do i create a macro to rename worksheets in excel?
I have a list of loan numbers that I want to use to rename worksheet tabs, any way to do that? I have used the following previously:- Sub Rename() Sheets("old name").Select Sheets("old name").Name = "new name" End Sub Hope this helps "Waki" wrote: > I have a list of loan numbers that I want to use to rename worksheet tabs, > any way to do that? Thanks, but I'm new to VB...I'm going to need a little more help. "Pank Mehta" wrote: > I have used the following previously:- > Sub Rename() > Sheets("...

need card view with active recurring and non-recurring appointments ...
I'm trying to set up a card view that will be a simple list of active appointments, both non-recurring and recurring. I have an Advanced filter, "Start .. on or after ... Today". The problem is the sorting. If I sort by "Start", then the recurring appointments are all listed in front of the non-recurring, because the Start date for a Recurring appointment is the FIRST recurrence. I then sorted first by "Recurring", then by "Start", so that non-recurring appointments are listed in front of the recurring, but that's not what I want, either. Wh...

Macro to run without any popups
I am a newbie but thought someone in this group could assist Trying to accomplish the following: Search for all ^p and replace them with ^| (soft return) and then find the following text =93please call with questions=94 and put that in bold anywhere in the sentence. However I am able to do the soft return with a macro but I don=92t want any popups to happen when I run the macro. Is that possible? Sub ScratchMaco() Dim oRng As Word.Range Set oRng = ActiveDocument.Content With oRng.Find .Text = "^p" .Replacement.Text = "^l" .Execute Replace:=wdRep...

application help
I am a new Access 2007 user. 15 years in auto repair and another 20 in fleet management. I am developing a fairly extenisve fleet management program. My question is how do I put the information useful to mechanic's in a file which can be accessed by F1 (helP) You need a helpfile generator. I don't know if you can get there via a web forum, but the newsgroup: microsoft.public.helpauthoring is the newsgroup that can help you out. There are also several 3rd party help authoring programs. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access ...