Hello all,
I am having an issue with some vb code and importing data from a .csv file. I have a software program that we export a series of data out of every morning. When the first series of data is exported it is saved in the format of "query_export_results.csv". However, the next series of...
Where do I run this from Skip? Can I just add this to a command button? Why SQL commands vs what I have originally? Just curious as I have not used these commands in a while. The problem I still have is that when I try to use my StartDate and EndDate commands for the following it doesnt work...
Can someoen take a look at this code that was created using a macro and the query builder? It looks messy with the breaks, but this is how it was recorded. I just edited the text for confidentiality reasons.
Sub Macro1()
With ActiveSheet.ListObjects.Add(SourceType:=0...
Ok, I just discovered a new issue with my form and data. The product list that I am using for the userform is a unique value list. It simply lists the 15 possible product choices. However, there are some records with more than one product selected such as Product1,Product2 or...
Thanks Skip. I will look into your suggestions. Thansk PHV, this seems to resolve the issue. Not sure why I didn't think of that. That's what I get for copying the code from somewhere else.
Darv.
Hello all,
I did some searches for this issue and there are some variations, but I can't seem to find my same issue. I am using Excel 2010 and have written/tweaked VBA code for a while now. I have a userform I created with 2 multi-select listboxes and 3 textboxes. The goal of my userform is to...
I was just as confused when I activated the sheet prior to the replace command and it still didn't work. I am not using any with statements so I just expected it to look at all the cells and do the replace. The only way I got it to work was to select the range of data where I knew the...
Yeah! I got it to work. The part about the narrow range got me thinking Pete. Because I selected the first cell where I wanted the data paste to start, that is the only cell that would have been affected, but this cell didnt have anything to replace. All I did was add the code to reselect the...
Hmm, thanks Pete. I will check this out when I return to work on monday. Initially this code gets executed from the first worksheet of the current month's file.
In the code I open the previous file, activate the Data Entry sheet, copy the data I want, switch to the current month's file...
Yes, I made the replacewrd a variable that would be able to handle the search/replace month after month as the file names change. I stepped into the code and checked the value of replacewrd right before the code I pasted above. The string that is formed is what I expected. That is why I can't...
Hello all,
I have an excel file that gets populated every month and resaved based on the current month/year. I need to routinely copy a range of data from the previous month's file into the current month's file. Within the copy range there are some formulas that use vlookups into another...
Well my suggestion to the end user was to put each "chunk" (month) of data on its own worksheet. If one month had more rows of data then it could go to a second page without the other months printing on multiple pages. All they have to do is print the entire workbook to get the same data...
Yes, everything is very easy to do manually. Of course I can look at the data and put the page breaks where I want them. Yes, I can look where the data ends and set my print area. All of this can be done after the fact by the user. What I attempted to do was build the code to do it all...
Well thats a start at least. Hmmm, the issue I get now is that if one month doesnt have the same number of rows its 2nd or 3rd page doesnt have data. I end up with a page with the page header and the column names, which was problem number 2. I am using the intlastrow to set my print area as well.
Hello all,
I tried searching through the forums and didn't see the exact issue I have so here goes.
I have some data that on a monthly basis gets copied to another workbook and saved. I am trying to automate the process of doing the data copy, file saving and page formatting.
So far I have...
I believe it was something like this(its at work so I am going by memory):
Sheets("Mysheet").Select
Range("A1:G404").Select
Selection.Copy
.....more code...
I then tried this which didnt work:
Sheets("Mysheet").Select
Range("A1:G404").Copy
.....more code...
What I have now that works is...
Thanks Skip. You've given me help in the past and I appreciate advice from anyone who knows what they are talking about.
In this particular case, the file opens to the same sheet every time and there is a procedure the users follow. In the code, I actually switch to the sheet I want the...
I went back and looked at the code and found that adding Activesheet in front of the range resolved the issue. I thought selecting the sheet in the previous line was sufficient but apparently not.
Skip, please excuse my VBA ignorance, why should I avoid using Select/Activate? I can see cutting...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.