Вы находитесь на странице: 1из 3

macros correctly

applying conditions in macros

output
prompt the name and tell us whether the person is a minor or major or a senior
citizen

minor -age <18


major 18<age<60
senior citizen >60
message --hi xx you are a xxx

IF (age < 18 ) then


message "hi name ,you are a minor"
else
if (age<60) then
message "hi name ,you are a major"
else
message "hi name ,you are a senior citizen"

new function starts with sub


dim age as integer
dim name as string
name = celss(1,1).values
age = cells(2,1).values
IF (age<18) then
msgbox("hi "+ name +"you are a minor!")
else
if(age<60) then

else

end if
end if

insert
button
calling function with button

filters
company with sector
identify a sector
paste it as per the requiremnt like bank as a output

all stocks of materials will go to other sheet


1>use excel for the code
2>logically manipulate the code

1.select cell a1
2.data->filters
3.select sectors
4.select and copy the full range
5.sheet 2 and select cell a1

dynamic filter
we were manually selecting the range
ctlr shift * -->whole range will be selected
selection.currentregion.select-->
difference between active x and other form
cleaning the data

creating charting using macros


authorised capital
paid upcapital

charting using vba


comments format
chart in different sheet

user to specify the sheet name


transfer the chart to that specific sheet name

execute item line by line


step into/f8
unneceesary coding can be deleted

userforms
creating userforms
interface to connect with the user and get information at the backend

calculting loan emi


banks
calculate emis
tenor loan amont

preliminary userform
insert>userform
it is invisibel layer
to be visisble -->activate and call it frm backend
select worksheet
activate option
when worksheet gets activated user form shud be displayed
userform.show
properties -->double click

userform has toolbox-->view


label
userinput-->textbox
command button
when press click print-->
double click-->subroutine wata

reset to change

advanced vba and macros


case study approach
non coders approach

emi calculator
>userforms-->front ending,text box,list boxes,buttons
>update now button>list gets populated from other sheets,linking
>reference sheet
>calculate emi >formulas
>sort emi>increasing order sort <increasing order>arrays
>creating graphs>dynamic graphs
>print reports
>email the report>outlook and send a pdf
what is userform
combobox
listbox
update now->connects to external sheet
how to refence within and external
dynamic update
vlookup
looping
arrays
dynamically connected to source data
reports

emi userform
>creating combobox
>first activate
with
end with
>taking dynamic values
for the list

row source
sheet2!A2:A16
>Recreating combox
if space in sheet2 use inverted comma

>listbox

Вам также может понравиться