Macro Recorded To Extract Data From Mainframe System?

Oct 12, 2012

I have following macro recorded to extract data from a mainframe system

open "C:DesktopReportRBDRBD.txt" for OUTPUT as #1
rc% = ps.sendstring("{clear}")
rc% = ps.sendstring("a24octdelbom*9w{enter}")
test1 = PS.getdata(450,3,27)
print #1,test1

The requirement here is run the above macro for the next 30 days automatically, for example

rc% = ps.sendstring("{clear}")
rc% = ps.sendstring("a25octdelbom*9w{enter}")
test1 = PS.getdata(450,3,27)
print #1,test1

and so on till 23 Nov. From the start date the macro should run for the next 30 days. Currently i am changing the dates manually in the macro

View 7 Replies


ADVERTISEMENT

Macro To Format Raw Data From Accounting System

Jun 14, 2013

I export raw data from my accounting system each month that I then format for use in another application that uses the data to produce customer statements. I have attached a file that shows the raw data in the first sheet and the formatted data in the second sheet. I recorded a macro while I did the process but I need to change the code to deal with dynamic data as the number of rows may be different every month.

Here are the steps I go through:
1. Clear the first 3 rows and the last 5 rows
2. Copy the totals in the last row of the data and paste them in the first row
3. Subtotal the different categories in row 2 and add a validity check
4. Add a new column A with a formula to add customer numbers on each line
=IF(ISERROR(FIND("00000",B5)),A4,B5
5. Copy the formulas and paste values over them
6. Filter the data to show blanks under the "Doc Date" column, delete all rows
7. Filter the data to show blanks under the "Type" column, delete all rows
8. Filter the data to show "Total:" under the "Apply No" column, delete all rows
9. Turn off filters, format all numbers in accounting format
10. Check the validation at the top to ensure no transactions were deleted

View 6 Replies View Related

Macro- Data That Is Exported Our House Investment System

Oct 27, 2008

i have a spreadsheet with data that is exported to Excel via our in house investment system, the report looks something like below, though real data consists of 2000 rows of data. Where we have O/S in Bank this means these entries are all physical bank entries i.e statement credit and statement debit, and where we have O/S not in Bank these are all accounting entries, i.e. Ledger Debit and Ledger Debit.

What i am after is a macro that will insert a column next to Team and then input SDR SCR on all statement entries and LDR and LCR on all Ledger entries, the final report should look like the second spreadsheet....

View 9 Replies View Related

Clean Up Recorded Macro?

Jun 1, 2014

I want to clean up this recorded macro but not sure how, it highlights duplicate values in a column

[Code].....

View 3 Replies View Related

Shortening Recorded Macro?

Jul 15, 2012

shortening the below recorded macro?

Code:
Sub Macro1()
'
' Macro1 Macro

[Code].....

View 3 Replies View Related

Eliminating Clutter In Recorded Macro

Oct 26, 2011

I have recorded the following macro and made few changes to it with my little VBA knowledge. But the code still looks very messy.

Code:
Application.ScreenUpdating = False
Sheets("Sheet2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;E:MacrosBSE Indices.iqy", Destination:=Range("A1"))
.Name = "BSE Indices"
.FieldNames = True

[Code] ..........

View 9 Replies View Related

Build Undo In Recorded Macro

Oct 2, 2006

I have recorded certain macros. But after executing macro 'Undo' do not work. How can I do it ?

View 3 Replies View Related

Recorded Macro Missing Paste Commands

Nov 13, 2008

I have been using the "record macro feature". What I want the macro to do is as follows.
1. cut all data from column C and paste it into G.
2. Use the textTocolumns feature to split a comma delimited string into 2 seperate columns.
3. user the textToColumns feature to remove any leading spaces from column G.
4. cut columns d-H and shift them left startign in column C.

I can do all of this find bu using the GUI while recording the macro but when I check the vb script it's completely missing the paste commands.

When I try and run the macro it, quite rightly, returns "run-time error '1004':No data was selected to parse.

Below is the resulting recorded macro.

How do I amend this macro do include pasting the cut data?

View 2 Replies View Related

Inserting A Muliple IF Statement In My Recorded Macro

Sep 21, 2009

I recorded a macro (which worked), then tried to get more out of it by adding code to add a further function (which didn't work). The code is as follows:-

View 3 Replies View Related

Loop Or Repeat Recorded Sort Macro?

Aug 10, 2011

I have a workbook where I need to sort data with range (K2:L24), then move down 208 rows and sort range (K210:L232) and repeat this upto 1000 times. I have shortened a recorded macro as an example and would like to know how to loop or repeat.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 6/04/2011 by Greg

[Code].....

View 4 Replies View Related

Recorded Macro - Apply On Pivot Table

Dec 8, 2011

Below is a recorded macro i am trying to apply on a pivot table.

Code:

Range("F4:H4").Select
Range("H4").Activate
Selection.AutoFilter
ActiveSheet.Range("$G$4:$G$100000").AutoFilter Field:=1, Criteria1:="21", Operator:=xlTop10Items

The problem i am facing is that when i am trying to run it is not working.

View 9 Replies View Related

Recorded Macro Incorrectly Hiding Columns

Nov 18, 2013

I've recorded a macro in which I unhide certain columns, copy and paste some information then hide those columns again. The problem is that when the macro is finished, it incorrectly hides columns K to AN. I did not record that and it's not in the code so I'm lost as to why it's happening.

The macro is as follows :

Code:

Sub COPY()
'
' COPY Macro
'
'
Application.ScreenUpdating = False
Columns("K:BT").Select
Selection.EntireColumn.Hidden = False
Range("M5:N24").Select
Selection.COPY

[Code]...

Why it's hiding everything from K to AN. I've tried recording the macro several times but it's just not working, no matter the order in which I hide columns when recording it.

View 5 Replies View Related

Worksheet Function Too Long To Be Recorded In Macro

May 11, 2009

I have a list of items in Sheet1 column A (starting from row 1).

I would like the corresponding column B to have certain values depending on the value in column A (same row), as follows:

If the value in column A has "SYS????CZ", column B should be "HPC"
If the value in column A has "SYSNIS", column B should be "NIS"
If the value in column A has "SYSJBE", column B should be "JBE"
If the value in column A has "ICG????", column B should be "HPC"
If the value in column A has "IL????", column B should be "RUP"
If the value in column A has "SYSHPC08", column B should be "HPC"

What I tried was to record a macro while typing the formula in B1: ...

View 9 Replies View Related

Speed-Up/Optimize Recorded Macro Code

Aug 30, 2006

Im setting up a spreadsheet that does engineering calculations. Im using macros to run sizes from a standard schedule. It basically takes the values from one sheet (schedule) to another (calculation), then the result from the calculation sheet (Value only, not the link) is pasted back into the schedule. The macro seems very bulky and im sure that it can be made more efficient with a loop. here is a sample of the code from the macro;

Sheets("Calc sheet").Select
Range("C6").Select
ActiveCell.FormulaR1C1 = "=Schedule!R[1]C"
Range("C7").Select
ActiveCell.FormulaR1C1 = "=Schedule!RC[1]"
Range("C8").Select
ActiveCell.FormulaR1C1 = "=Schedule!R[-1]C[2]"
Range("C9").Select
Sheets("Schedule").Select
Range("G7").Select..................

View 3 Replies View Related

Recorded Macro Not Including All Rows. 2007

May 30, 2008

I manually create a pivot table (and record my actions) the pivot table references all of the information in my data range (70k+ lines). When I run the recorded macro the new pivot table limits the data range to the first 65536 lines (the old limit)....

View 6 Replies View Related

Recorded Macro Doesn't Seem To Provide Expected Result

Sep 21, 2009

On column A, I simply do an A-Z sort that gives the expected result. So I recorded it as a macro. In column G is a code that corresponds with column A. When the marcro is executed Column A is sorted but the corresponding value in G stays where it is. Clicking the A-Z button works. But when that action is recorded as a macro I get the above quirck. Since VBA is not my beef, I don't really know what wrong.

View 4 Replies View Related

Converting Recorded Macro Into Workable VBA To Add New Sheet At End Of Workbook

Apr 22, 2013

I have a button with a macro assigned. The macro needs to create a new worksheet at the end of the workbook, rename the new sheet to "New County", make the cell size match the rest of the workbook, and then paste in a template from another sheet called "Master".

I recorded a macro that does this, but it has a static reference to the new sheet instead of what ever the new sheet is. So the Macro works one time, but never again. I'm sure this is an easy fix, and perhaps there is a much easier way to do this, but my limited VBA knowledge is hampering me.

Code:

Sub AddNewCounty()
'
' AddNewCounty Macro
' Adds a new County sheet to the workbook.
'
'

[Code]...

View 9 Replies View Related

Excel 2010 :: Result Of Recorded Macro Is Different From Hand Work

Mar 10, 2014

I have csv file with tab delimited fields (see attached blacklist.csv). 3rd and 4th fields are in format dd/mm/yyyy hh24:mi:ss, some fields can be zero. I need to split data to columns and display datetime fields in format dd.mm.yyyy hh:mm:ss.

OK... open csv in Excel, select column A, press button "Split in columns", select tab as delimiter, choose date format (DMY) for 3rd and 4th field and press OK. Test is splitted into columns, now select columns C and D and select desired format "dd.mm.yyyy hh:mm:ss". Then I select columns A:E and set column widths to fit data in columns. This all is OK and without problems (see attached file Handmade.xlsx).

But now... Now I record all previous step into macro. There is macro text: [Code] ....

Now I copy macro text into clipboard and open blacklist.csv again. Insert button to list and bind it to new macro. Paste text of macro from clipboard. (See attached file blacklist_beforeClick.xlsm). Now click button Btn and voila... some dates remain in previous format, some dates seems to be in desired format, but day and month are swapped. Why are there differences when comparing data made by hand and data made by macro??? compare.jpg This is the same behavior in more computers, some use Czech version of Excel 2010, some use English version.

View 2 Replies View Related

Functions-data Recorded For Every Day For Some Subjects

Jan 9, 2006

I have some data recorded for every day for some subjects.

And the possible recorded value on each day is: 0 or 1 or 2 or 3 or 4 or null.

I have this type of data for number of subjects over many months.

My data looks like below.

Subjectnameyearmonth day1day2…………..day30day31

Name1990January 2044
Name1990February 31nullnull
Name1990March 2null31
So on.

I need to calculate the following 3 for each row.
1) On which day of the month first occurrence of the 4 comes?

This one I figured out using match() function which I paste below.
=MATCH(4,N2:AR2,0).

2) On which day of the month last occurrence of the 4 comes?
My data can not be sorted, and I couldn’t use match function here.

3) If there are any 4’s in a month, how many consecutive 4’s are there?

View 14 Replies View Related

Capturing Lowest Value Recorded In Data That Changes?

Jan 3, 2012

I run a golf handicapping system that utilises excel quite heavily to record a LOT data over the course of a season. In essence we have in excess of 50 players who play once or twice a week and I record their Stableford scores (dont worry that's a golfing phrase but it is basically how they performed that day) and adjust their golf handicap accordingly - all in XL.

So - a player may start the season with handicap of 20 but over the season this will vary up and down as each score is recorded. A player may well play in excess of 50 rounds in a season.

I currently record the player's starting handicap in one column and in the next column appears the freshly calculated new handicap after a new score has been entered. The column containing the new handicap overwrites the old handicap value each time it is recalculated.

All I want to do is to create a 3rd column that records the lowest handicap value attained during the season. So for each player I guess it should take the newly calculated handicap and decide if it is lowest it has 'seen' in that column and if it is record it.

View 9 Replies View Related

Automate Recorded Macro - Sort Range Of Cell Based On Two Values

Jan 23, 2013

I have recorded a macro to sort a range of cell based on two values that is dependent on time in another cell. I now want the macro to run automatically when refreshing the workbook with F9, so as the time changes so will the sorting. Everything works fine except the sorting doesn't refresh when F9 is refreshed.

My recorded macro is:

VB:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Long, FillCT As Long
For X = 1 To 4
If Cells(Rows.count, 1).End(xlUp).Offset(0, X - 1) <> "" Then FillCT = FillCT + 1

[Code] .....

View 4 Replies View Related

Excel 2010 :: Change Default Pie Chart Colors In Recorded Macro?

Mar 20, 2014

I am working on a project where I am virtually almost finished except for a minor change with the pie chart. I am analyzing some data and recorded a macro to do this and also the pie chart for visualization. However, I do not like the color of the default pie chart colors and would like to customize it. How could I change this within the macro I have recorded?

[Code] .....

View 4 Replies View Related

Looping Recorded Macro - Copy And PastE Information From One Cell To Other Cells

Jul 15, 2014

I've recorded a Marco copying and pasting information from one cell to other cells and some of the copying functions paste to two cells. I just need this to loop through all information I'm copying from the the new cells.

Range("I1").Select
Selection.Copy
Range("D1").Select
ActiveSheet.Paste
Range("J1").Select

[Code]...

View 7 Replies View Related

Disable Command Button Once Data Is Recorded

Aug 7, 2008

I am making a timesheet which has a UserForm with textbox and 3 command buttons namely Search, IN and OUT. The program works like this, user type his id no., then clicks on search, once id match command buttons for IN and OUT are enabled. User clicks on IN button then current time which tags as NOW() will be pasted on the worksheet. Same goes with the OUT button. I was able to make them work that way. The problem here now is, the data being entered are vulnerable for data-re entry. What I mean is, if a certain user has already a recorded IN time, if he clicks on the IN time again, the data will be overwritten. Is there a way that once the user has already a recorded IN time, the IN button will be disabled for that user since he has already a recorded IN data?

View 14 Replies View Related

Data Sequence - Order Recorded Date

Dec 16, 2013

Find below the data sequence. 1st is the customer code, next are the date we have recd. the orders. In one excel command i want to find out the when was the order recd. date.

Code
17.11.2013
18.11.2013
19.11.2013
20.11.2013

11310
178
1235
1235
176

[Code] ......

If I give code and order qty then the formula should go to the code row and find out if any order of that qty had come if yes then date has to be returned as a result.

View 9 Replies View Related

VBA Excel To Take Screenshots From Mainframe

Nov 20, 2013

I'm looking to develop a VBA Excel macro that will take a screenshot from Mainframe and post back into Excel . (its part of a bigger procedure for sure - but just going to take it in bite sizes)

Some sample code with Excel and mainframe and screenshots.....

View 1 Replies View Related

Excel 2011 :: Mac Recorded Macro Does Not Work With Windows - Runtime Error 1004

Nov 20, 2013

I have been given a macro recorded on a mac and it works fine with Mac Excel 2011. Unfortunately, I need to make it to work on a windows machine, but it comes up with an error message "macro unable to set width property of the window class. Run-time error 1004". When I press debug it takes me to the line .Width = 1456.

Below is the chunk of the code that becomes highlighted when pressing debug.

With ActiveWindow
.Width = 1456
.Height = 795
End With

View 3 Replies View Related

Manipulate Rumba Mainframe Display

Apr 15, 2008

I routinely work with RUMBA mainframe display and was trying to create a VBA macro to enter data from a spreadsheet into the mainframe but after pressing enter the mainframe has random wait times on the status bar saying "Host Busy...Please Wait" and then changing to "Ready" when able to accept my next command.

how I can make a method of waiting for the mainframe to be ready before excel continues its sendkeys.

View 5 Replies View Related

Macro To Extract Data

Oct 7, 2008

I would like to create a macro so that it will pull all the data from the worksheet "Data" and put it onto worksheet "Extracted Data". However I only require the rows which have Booking Office No SU17.

View 3 Replies View Related

Macro To Extract Data

May 24, 2014

Macro that extract information i need from column A into column B. My file contains comments regarding a sale made by a manager. And, the only information that pertains to me is the bags it will be using.

Below is a example of a comment (ROW 28 of the file):

PO 186
TRADER
SHIPPING WITH BROWN
240 X 20 # PANDA $ 9.90 EACH $ 49.50 CWT.
850 X 40 # PANDA $ 19.05 EACH $ 47.63 CWT.
US # 1 MAX. 4% BROKENS

The only information i need is 240 X 20 # PANDA and 850 X 40 # PANDA.

In the file, the Bags Tab, lists the names of all of the bags we current have in our inventory. I was thinking that a macro can run through column A of the comment tab and if it finds a match in the bag tab it would list it out in column B of the comments tab.

Here is my file. [URL]....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved