basically I got 2 sheets - 'Sheet1' and 'Codes'. In sheet 1 I have many columns of info(irrelevant here), we focus on one Column N, there are codes in this column and depending on the code I need to enter an Asset Class in Column AG. The Sheet (Codes) - has 2 columns with the code(column A) and its corresponding asset class in Column B.
A lot of the codes belong to the same asset class so dont be confused if u see the same asset class category twice. I need the macro to copy the correct asset class value from Column B(Sheet 'Codes) to Column AG of Sheet1.
Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = Chr(vbKeyA) Then If sngXFactor 1 Then sngXFactor = -1 sngYFactor = 0 End If ElseIf KeyAscii = Chr(vbKeyW) Then If sngYFactor -1 Then sngXFactor = 0 sngYFactor = -1 End If ElseIf KeyAscii = Chr(vbKeyD) Then If sngXFactor -1 Then sngXFactor = 1 sngYFactor = 0 End If ElseIf KeyAscii = Chr(vbKeyS) Then If sngYFactor 1 Then sngXFactor = 0 sngYFactor = -1 End If End If End Sub
That is what I have right now, basically I just want to map W, A, S, and D to change variables. What am I doing wrong?
Keep in mind that this is a userform and not an excel worksheet.
I am using the Formula of Index here as i have a sheet names with Details and mapping i have a company name for which i have to map the policy no from the details sheet. The Thing is i will not use Vlookup i need a formula of Index which maps the data from the backwards range. Attached a excel sheet.
I need to count a list of corporates claims settled as i have multiple Claims Status as outstanding, In process,Cheque prepared and Etc.
Basically i cannot use countif formula for the condition as it has only a range & criteria but here i have to check the list in the validation tab and map with the details in the side spread sheet given which are settled and count them so such criteria is so unknown to me to use .
I created a sort of FORM worksheet that uses lookups to pull a bunch of information (so the user does not have to key it all in,) and transfers it to a second worksheet (database worksheet), when the user clicks a "Submit" button.
The functionality is fine when used by one individual, but I am now going to have 9 different users working within this Shared file.
I seem to have worked out any of the other kinks related to the Shared file, but I'm having one problem that I should have foreseen.
The code below is looking for the next available empty row in the database sheet and copying the data there.
My problem is that the file is not updated in real-time, so if entries are submitted in a narrow time-frame, the data is fighting for the same row, and deleting one row-item or another.
My question is, is there a way to modify what I already wrote to fix this problem?
If not--the solution that I am thinking of is creating NINE separate worksheets and mapping the data into those individualy.
So... IF we have Sally, John, Scott, Dave, Jenn They each have their own worksheet.
From looking at the below, I am thinking the best option would be obviously mirroring the template for each user, and modifying this portion:
VB:
Option Explicit [U]Dim wsData As Worksheet [/U]Dim wsForm As Worksheet Dim wsPCD As Worksheet Dim rNextCl As Range Dim rNextC2 As Range
[Code]....
Will that work transitioning into the rest of the code? I'll assume that the above needs revised as I'm new to this all.
VB:
Option Explicit Dim wsData As Worksheet Dim wsForm As Worksheet Dim wsPCD As Worksheet Dim rNextCl As Range Dim rNextC2 As Range
I have a user whose links in his spreadsheets are in UNC format. He changes them to drive letter mappings, but when he opens the workbook again, the UNC format returns. how to change the links so that they remain as F: etc.. rather than \servernamesharename The user has MS Excel 2000 and Windows Xp Professional
I have a macro that pulls specific data from a CSV, then I copy that extract to my master excel doc (setup by year), so I can put the data into pivot tables and charts. This is used to create "management" style reports.
This data has IP addresses in it. Both internal and external. Trying to find a formula that will look at Cell A, where the IP address is and input either External or Internal into column AA, based on the number.
Internal would be numbers between 10.0.0.0 and 10.255.255.255, 172.16.0.0 and 172.31.255.255, and 192.168.0.0 and 192.168.255.255. Anything not in those three ranges would show as External.
I have some buttons in different sheets in an excel file, each button has its own code, that is the reason I can not move the code related to each object to another location (sheet or module).
And I have one piece of code in Module1 (Auto_load) in order to execute automatically this routine every time file is opened. Inside "auto_load" routine I initialize some values of some check buttons,options buttons and positions of some objects in diferent sheets, but I can not pass the value of variables between Module and Sheet's code even when I declare as public variables and/or function.
I am using the code below that I got off of these forums to email a particular sheet in my workbook, but I need to strip all of the VBA code and the command button from the sheet being sent.
In the attachment you will see an example of what I am trying to accomplish. What I am trying to do is find VBA code that will move data by date from an (Entry) sheet to a (Historical) sheet. I want to enter a date in B3 on the (Entry) sheet. I then enter data into C3. What I would like to happen is when the data is entered into C3 the sheet goes and finds the same date that I entered in B3 and copies that data from C3 into Column E of the (Historical) sheet.
I have two sheets. First contains Department # 0002549, and the other one contains 5 more digits(#02001 0002549). I will need to find the exact match for the first sheet to contain all 12 digits. THey are all in different order, so I probably have to match them first then add whatever the first 5 digits number. How should I tackle this issue? I was thinking to use vlookup but how could you use vlook up if only last 7 digit matches and add addtional digits to exisiting number?
I am trying to set up vba as part of a macro that will do the following: Open a master workbook
Open a data workbook( There will be a few of these to process) Copy the data from a data workbook sheet (INPUT SHEET) to INPUT SHEET in the master workbook. I will rename the master and then continue with the same process for the next data workbook. I cannot copy/move the input sheet because of an MS bug whereby all of the sheet coding is lost whe you insert a sheet into a workbook.
I have set up a sheet in the master workbook that lists all of the data workbook names and paths I set the data workbooks up with a string variable name of TRGT.
I can get the coding to open the TRGT workbook but am having trouble getting the subsequent sheet commands to work in order to extract the data.
I need to write a code for a workbook with multiple sheets. Starting at sheet 1, I need to perform an action, and then move on to the next sheet to perform the same action. I need to do this for all sheets in my workbooks (sometimes over 20 sheets). How should my macro look? I have learned the code to perform the action I need. I just can't move from sheet to sheet. I would assume this would be some sort of Loop statement until there are no more sheets.
I use my workbook to track sales data from one store to the next. I use my workbooks to compare data from year to year. Each year's data is displayed on a separate worksheet. '2013' has 2013's data, '2014' has 2014's. On the 2014 sheet, I have a Prior Year's Sales that pulls data from the previous year's spreadsheet using a formula which I just drag down each day I enter sales. I would like to automate this process and have the VBA code check for today's date and automatically pull the previous year's sales data from the '2013' sheet and put it in the appropriate cell on the '2014' worksheet. I hope I have explained this well enough to understand. I've included a link to my workbook for reference.
I had to use dropbox since I can't post a file over 1 MB. The file size is around 1.25 MB.
I am going through my workbook and changing my macros to refer to the sheet code name instead of the actual sheet name. I was wondering, how do I change the reference in an IF/Then which refers to the sheet by the name? I would like the IF/Then to refer to the sheet by its code name.
For example:
If ActiveSheet.Name = "G&I" Or ActiveSheet.Name = "Growth" Then
I want to display value from cell A11 to J11, and when the button is clicked, I need to transfer the value to underneath the last value on sheet “Results” leaving 1 space. So in my example it would go into row 28. On other occasions there may only be 1 value for example on results, if this was the case the row from Additional parts would have to display in row 7.
Then if I were to add another value in additional parts I would then want this to display in row 30 in my example. So again leave a space and add the line.
right now this code exports to another sheet, and only exports the active cell. I want to export to a new spreadsheet with a new name, and a given area instead of just the active cell.
I'm looking for a code that automatically changes the format of any pasted in data to Match destination formatting. Not getting the results I want from protecting the sheet.
I have a workbook that imports sheets from other workbooks. Each of these sheets need to have the following in the sheet module...
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveCell.Address = "$P$1" Then Range("P11:V250,Q10:V10").Select Selection.Clear Range("P10").Select End If End Sub
How do I accomplish that through a module in the original workbook?